[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

EVAL() -- is this a bug???



If I execute the JS code below as it stands, it works correctly.  However, if I
comment out statements 3 and 4 and enable statements 1 and 2, the code opens a
new window, but there is no document displayed in the window.

Is this related to the bug described in Andy Augustine's FAQ, which indicates
that EVAL strings are compiled into byte codes?

Thanks.

Bill
====================================================================
<head>
<script language=javascript>

function doit() {
   var str='drcr-frame.html';
 // eval('window.open("' + str + '","namer")');     // STATEMENT 1
 // eval('window.open("' + str + '","namer")');     // STATEMENT 2
   window.open("drcr-frame.html","namer");          // STATEMENT 3
   window.open("drcr-frame.html","namer");          // STATEMENT 4
}

</script>
</head>

<body>
<form>
<input type = button value = "Do It" onClick="doit();">
</form>
</body>

--------------------------------------------------------------------
For help about the list, please send a message to 'majordomo@obscure.org'
with the message body 'help'. To unsubscribe, send a message to
'majordomo@obscure.org' with the message body 'unsubscribe javascript'.
List archives and pointer to FAQ: http://www.obscure.org/javascript/