P
playmaker
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.floor(screen.width/2-w/2)+",";
features += "top="+Math.floor(screen.height/2-h/2)+",";
features += "alwaysRaised=yes,";
features += "width=" + w + ",";
features += "height=" + h;
nw = window.open(url, nome, features);
nw.document.open();
nw.document.write("<html>");
nw.document.write("<head>");
nw.document.write("<title>"+tD+"</title>");
nw.document.write("</head>");
nw.document.write("<body leftmargin='0' topmargin='0' marginwidth='0'
marginheight='0'>");
nw.document.write("<img src="+pD+" width="+w+" height="+h+" title="+tD+">");
nw.document.write("</body>");
nw.document.write("</html>");
nw.document.close()
}
</script>
<a
href="javascript
penPop('popup.htm','des','499','610','desert.jpg','desert')">b1</a>
<a
href="javascript
penPop('popup.htm','tus','330','630','cactus.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.floor(screen.width/2-w/2)+",";
features += "top="+Math.floor(screen.height/2-h/2)+",";
features += "alwaysRaised=yes,";
features += "width=" + w + ",";
features += "height=" + h;
nw = window.open(url, nome, features);
nw.document.open();
nw.document.write("<html>");
nw.document.write("<head>");
nw.document.write("<title>"+tD+"</title>");
nw.document.write("</head>");
nw.document.write("<body leftmargin='0' topmargin='0' marginwidth='0'
marginheight='0'>");
nw.document.write("<img src="+pD+" width="+w+" height="+h+" title="+tD+">");
nw.document.write("</body>");
nw.document.write("</html>");
nw.document.close()
}
</script>
<a
href="javascript
<a
href="javascript