...

View Full Version : windwo.open plroblems



bobyyjavascript
12-19-2005, 04:58 PM
Im new to javascript and cant get my head round why this is not working i even copied direct from the book which i found had mistakes.

<DOCTYPE HTML PUBLIC "-//W3C/DTD HTML 4.01 TRANSITIONAL//EN

"http://www.w3.org/TR/html4/loose.dtd">

<HTML>

<HEAD>

<TITLE>oPENING A WINDOW<TITLE>

<SCRIPT LANGUAGE="JAVASCRIPT" TYPE=TEXT/JAVASCRIPT">

function newWindow() {

catWindow = window.open("Sunset.jpg", "catWin", "width=330,height=250");

}


</SCRIPT>

</HEAD>

<BODY>

<a HREF="javascript:newWindow()">click me</a>

</BODY>

</HTML>

id be real greatful if any 1 could help me

coothead
12-19-2005, 05:18 PM
Hi there bobyyjavascript,

and welcome to codingforums. :)

Try it like this...

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>opening a window</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script type="text/javascript">
<!--
function newWindow(url) {
catWindow = window.open(url,"catWin","width=330,height=250");
}
//-->
</script>

</head>
<body>

<a href="Sunset.jpg" onclick="newWindow(this.href);return false">click me</a>

</body>
</html>
coothead

Nischumacher
12-19-2005, 05:25 PM
<DOCTYPE HTML PUBLIC "-//W3C/DTD HTML 4.01 TRANSITIONAL//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>oPENING A WINDOW</title>

<script language="javascript" type="text/javascript">



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum