function problems

admin

Administrator
Staff member
Ive been slaving over this for six hrs. Can someone please tell me why the img isnt loading into the new win.

I have to load four differnet img into the same window name...but i cant even get this one to work!

the code::

<html><head>
<title>Image in Popup Window</title>

<SCRIPT Language="JavaScript">

function displayPhoto(url,width,height,descrn) {

var url="";

var name="popup";
/*this var is called name which Thau says I shouldnt???*/
var w=width+50;
var h=height+120;

var features="width=" + w + ",height=" + h;

features+=",menubar=yes,scrollbars=yes,location=yes,status=yes,toolbars=yes";

var myNewWindow=window.open(url,name,features);

myNewWindow.focus();

myNewWindow.document.open();

myNewWindow.document.write("<html>");
myNewWindow.document.write("<head>");
myNewWindow.document.write("<title>image into new win</title>");
myNewWindow.document.write("<style type='text/css'>");
myNewWindow.document.write(" h1 {color:#003300;}");
myNewWindow.document.write(" body {background-color: red;}");

myNewWindow.document.write("</style>");
myNewWindow.document.write("</head>");
myNewWindow.document.write("<body>");
myNewWindow.document.write("<DIV ALIGN='CENTER'>")
myNewWindow.document.write("<h1>headline here</h1>");

myNewWindow.document.write("</DIV>");
myNewWindow.document.write("<form><br>");
myNewWindow.document.write("<input type='button' value='http://www.webdeveloper.com/forum/archive/index.php/Close' onClick='parent.close()'><br>");
myNewWindow.document.write("</form>");
myNewWindow.document.write("</body>");
myNewWindow.document.write("</html>");
myNewWindow.document.close();

}

</SCRIPT>
</head>

<body>

<a href=http://www.webdeveloper.com/forum/archive/index.php/"JavaScript:displayPhoto('images/whatever.jpg',600,400,'a view from above')">A view from aboven</a>

</body></html>
 
Back
Top