Pop up modal browser window inside another browser

J

Jimmy

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
 
D

David Golightly

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
 
T

Thomas 'PointedEars' Lahn

David said:
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
 
D

David Mark

[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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,997
Latest member
mileyka

Latest Threads

Top