Hi,
I have two buttons calling the same funtion to open a popup window,
dinamically built according to parameters passed to the function.
The problem: when I click the first button (or the second), anything
goes. When I call the function again /that is, from the athor button), I
get no window subtitution: that is, the second popup loads into the
first, loosing w and h too...
I simply need this substitution: is this possible?
Thanks to everybody in advance, PM
---
<script>
function openPop(url, nome, w, h, pD, tD) {
var features = "";
features += "scrollbars=no, ";
features += "menubar=no ,";
features += "resizable=no," ;
features += "left="+Math.fl oor(screen.widt h/2-w/2)+",";
features += "top="+Math.flo or(screen.heigh t/2-h/2)+",";
features += "alwaysRaised=y es,";
features += "width=" + w + ",";
features += "height=" + h;
nw = window.open(url , nome, features);
nw.document.ope n();
nw.document.wri te("<html>");
nw.document.wri te("<head>");
nw.document.wri te("<title>"+tD +"</title>");
nw.document.wri te("</head>");
nw.document.wri te("<body leftmargin='0' topmargin='0' marginwidth='0'
marginheight='0 '>");
nw.document.wri te("<img src="+pD+" width="+w+" height="+h+" title="+tD+">") ;
nw.document.wri te("</body>");
nw.document.wri te("</html>");
nw.document.clo se()
}
</script>
<a
href="javascrip t:openPop('popu p.htm','des','4 99','610','dese rt.jpg','desert ')">b1</a>
<a
href="javascrip t:openPop('popu p.htm','tus','3 30','630','cact us.jpg','cactus ')">b2</a>
I have two buttons calling the same funtion to open a popup window,
dinamically built according to parameters passed to the function.
The problem: when I click the first button (or the second), anything
goes. When I call the function again /that is, from the athor button), I
get no window subtitution: that is, the second popup loads into the
first, loosing w and h too...
I simply need this substitution: is this possible?
Thanks to everybody in advance, PM
---
<script>
function openPop(url, nome, w, h, pD, tD) {
var features = "";
features += "scrollbars=no, ";
features += "menubar=no ,";
features += "resizable=no," ;
features += "left="+Math.fl oor(screen.widt h/2-w/2)+",";
features += "top="+Math.flo or(screen.heigh t/2-h/2)+",";
features += "alwaysRaised=y es,";
features += "width=" + w + ",";
features += "height=" + h;
nw = window.open(url , nome, features);
nw.document.ope n();
nw.document.wri te("<html>");
nw.document.wri te("<head>");
nw.document.wri te("<title>"+tD +"</title>");
nw.document.wri te("</head>");
nw.document.wri te("<body leftmargin='0' topmargin='0' marginwidth='0'
marginheight='0 '>");
nw.document.wri te("<img src="+pD+" width="+w+" height="+h+" title="+tD+">") ;
nw.document.wri te("</body>");
nw.document.wri te("</html>");
nw.document.clo se()
}
</script>
<a
href="javascrip t:openPop('popu p.htm','des','4 99','610','dese rt.jpg','desert ')">b1</a>
<a
href="javascrip t:openPop('popu p.htm','tus','3 30','630','cact us.jpg','cactus ')">b2</a>
Comment