0

I'm getting an error in line 13 and don't know why. Can someone help me please?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<script language="JavaScript">

 

function popUp(URL) {

eval("page" + id + " = window.open(URL, '" + id + "', '

toolbar=1,

scrollbars=1,

location=1,

statusbar=1,

menubar=1,

resizable=1,

width=500,

height=500,

left = 390,

top = 150');");

}

</script>




</head>

<body>

<form>

<input type=button value="Open Popup" onClick="javascript:popUp('www.rrc.mb.ca')">

</form>


</body>
</html>
4
Contributors
5
Replies
6
Views
5 Years
Discussion Span
Last Post by Airshow
0

either that, or define an id, but since you pass URL as a param to that function and don't use it otherwise, that might very well solve your problem.

0
  • Javascript does not allow a quoted string definition to be broken by line feeds.
  • There's no need to use eval() . It should be fairly easy to find a work-around to avoid it.
  • id is undefined unless it is in an outer scope (eg the global scope).

Airshow

Edited by Airshow: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.