Forum Moderators: open
function openWin(page)
{
myWin= open(page, "popupWindow",
"width=475,height=670,status=no,toolbar=no,scrollbars=yes,menubar=no,screenX=0,screenY=0,");
}
and then
<a href="javaScript:openWindow('path to file')">Link Name</a>
problem: only one can be opened at a time, how can i tweak the code so that i can have multiple of these fitted windows at the same time
[edited by: BlobFisk at 6:37 pm (utc) on Nov. 5, 2004]
[edit reason] Disabled Smilies to make code readable! [/edit]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
</head>
<body>
<script type="text/javascript">
var wins=new Array(4);
var wins_ln=wins.length;
for(var i=0;i<wins_ln;i++){
var pad=i*10;
wins[i]=window.open("","","height=200px,width=300px,left="+pad+",top="+pad)
}
</script>
</body>
</html>
By the way, screenX & screenY in the window.open features context is for NN 4. The feature attributes left and top are more widely supported.
I'm writing an app that's sort of a 'monitor' kind of thing and opens a window and writes diagnostic info to that window. It does this by opening a file called err.html that just does
onLoad=opener.update();- and the function
updateis just does
windowHandler.document.openand a long string of
windowHandler.document.writelnstrings to write to that other window - all this is output at the end of the 'normal' HTML output. It's nice since I can change the config so it can just use the same window that's open, or always open a new window if I rename it.
What I'm wondering now is if it would be possible to do something similar, except in the case that no window is open, a frameset opens up - the top frame would be a php script that modifies the configuration of the monitor thingie, so just opening a php or html file; and the cross-window scripting part (all these
windowHandler.document.writelnlines) would go into the named target of this second frame.
In the case that this frameset popup was already open, the script would just write to that lower, named target frame, and wouldn't open up a whole new window.
I'm not asking for actual code (although it'd be welcome as a good example is always a great help), but to pointers - whether this is possible for someone who's no js genious, and how / where I could figure it out.
I guess that if it's not really possible, I'd just want to have the frameset always re-load both top and bottom frames.
Many thanks in advance.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
var targ='<iframe name="frmOne"><\/iframe>';
function mkWin(){
if(typeof winOne=="undefined" ¦¦ winOne.closed){
winOne=window.open("","oneWin","height=200px,width=300px,left=200px,top=200px");
}
}
</script>
</head>
<body onload="mkWin();">
<a href="#" onclick="alert(winOne.closed);winOne.focus();">check open or closed status of window</a>
<br /><br />
<a href="#"
onclick="winOne.document.body.innerHTML+=targ;winOne.focus();">add iframe to window</a>
<br /><br />
<a href="#" onclick="mkWin();winOne.focus();">make win manually (if closed)</a>
<br /><br />
<a href="your_file.htm" target="frmOne" onclick="winOne.focus();">targeted link</a>
</body>
</html>