Pop up modal browser window inside another browser

Discussion in 'Javascript' started by Jimmy, Aug 14, 2007.

  1. Jimmy

    Jimmy Guest

    Is it possible to open a pop-up browser window (modal-style) inside
    another browser?

    e.g.
    // assuming something is calling this function inside the html as some
    event got triggered
    function doSomethingInDiffWindow() {
    // do something
    // open up a pop-up modal window
    // continue back on doing something after pop-up modal window
    closed
    }

    Thanks,
    Jimmy
     
    Jimmy, Aug 14, 2007
    #1
    1. Advertising

  2. On Aug 14, 2:06 pm, Jimmy <> wrote:
    > Is it possible to open a pop-up browser window (modal-style) inside
    > another browser?
    >
    > e.g.
    > // assuming something is calling this function inside the html as some
    > event got triggered
    > function doSomethingInDiffWindow() {
    > // do something
    > // open up a pop-up modal window
    > // continue back on doing something after pop-up modal window
    > closed
    >
    > }
    >
    > Thanks,
    > Jimmy


    Got to get some terminology straight. "Browser" is shorthand for User
    Agent, which is the "make" of a particular navigator (IE, Firefox,
    Safari, etc.) Using standard client-side JS alone, there are no
    straightforward techniques to get one "browser" to manipulate another.

    What you probably mean (though I can't be sure) is "window", which
    refers to the actual window of a particular browser. In JS, the
    "window" is just another object, and your script can have references
    to multiple windows (in general, as long as they're opened by a user-
    triggered action in your script - most UAs now block script-triggered
    popup windows).

    So instead of using window.open, you want a window inside of a
    window. Which means <iframe>. Making it modal is no mean task, but
    you might investigate Lightbox http://www.huddletogether.com/projects/lightbox/
    for relevant techniques. The code is there, I leave it for you to
    inspect it.

    -David
     
    David Golightly, Aug 15, 2007
    #2
    1. Advertising

  3. David Golightly wrote:
    > Got to get some terminology straight.


    Yes, please. Eventually.

    > "Browser" is shorthand for User Agent,


    It isn't. Web browsers are a *subset* of ([X]HTML) user agents, and because
    they are the greatest subset, many people (especially uninitiated) refer to
    Web browsers only.

    http://www.w3.org/TR/html401/conform.html#didx-user_agent

    > which is the "make" of a particular navigator (IE, Firefox, Safari, etc.)


    Depending on what you mean by "make" that statement may be wrong.

    > Using standard client-side JS alone,


    What would "standard client-side JS" be, knowing that any ECMAScript
    implementation itself is proprietary by definition and different not
    only by the ECMAScript standard's provision but also empirical proof?

    > there are no straightforward techniques to get one "browser" to
    > manipulate another.


    Fair enough because of the "straightforward".

    > What you probably mean (though I can't be sure) is "window", which refers
    > to the actual window of a particular browser. In JS, the "window" is
    > just another object,


    Windows (and frames) are represented in the AOM of the UA as Window
    objects. These objects are host objects which clearly distinct them
    from native objects; they are _not_ part of the programming language,
    but implementations of APIs.

    > [...]
    > So instead of using window.open, you want a window inside of a window.
    > Which means <iframe>.


    It could also be a `frame' element.

    > Making it modal is no mean task,


    It is an impossible task instead.

    > but you might investigate Lightbox http://www.huddletogether.com/projects/lightbox/ for
    > relevant techniques.


    Rather not.

    > The code is there, I leave it for you to inspect it.


    I consider it bad advice to refer a newbie who is unable to make an educated
    evaluation of code which authors themselves did not know what they were
    doing to that code.


    PointedEars, working down his TODO list
    --
    "Use any version of Microsoft Frontpage to create your site. (This won't
    prevent people from viewing your source, but no one will want to steal it.)"
    -- from <http://www.vortex-webdesign.com/help/hidesource.htm>
     
    Thomas 'PointedEars' Lahn, Oct 6, 2007
    #3
  4. Jimmy

    David Mark Guest

    On Aug 15, 12:35 pm, David Golightly <> wrote:

    [snip]

    Lightboxhttp://www.huddletogether.com/projects/lightbox/
    > for relevant techniques. The code is there, I leave it for you to
    > inspect it.


    I tried, but the download link was a 404. No matter, it uses not only
    Prototype but Scriptaculous (sp?) as well. In other words, it is 150K
    + to center an element. And since it is on version 2.02 and the
    release notes indicate they didn't address supporting IE6 with "any
    doctype" until 2.01, I think it is likely a lousy effort.

    The correct answer to the question is that you can't make one element
    modal unless you hide or disable every other element on the page. You
    can stretch an element across the document all you want (provided CSS
    is available), but this does nothing to prevent keyboard input and is
    therefore useless for modality.
     
    David Mark, Oct 7, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    1
    Views:
    3,184
    Whitecrest
    Jun 1, 2004
  2. Arnab das

    Modal pop up like window.confirm

    Arnab das, Mar 24, 2008, in forum: ASP .Net
    Replies:
    4
    Views:
    6,760
    Arnab das
    Mar 24, 2008
  3. Matt
    Replies:
    0
    Views:
    225
  4. gopal srinivasan
    Replies:
    0
    Views:
    257
    gopal srinivasan
    Nov 5, 2004
  5. magix

    Pop-up Modal Window

    magix, Feb 23, 2008, in forum: Javascript
    Replies:
    1
    Views:
    133
    magix
    Feb 23, 2008
Loading...

Share This Page