If I put some JavaScript in the head of a HTML page, such as:
Code: Select all
<script language='JavaScript'>
<!--
function jsopen(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=425,height=250');");
}
// -->
</script>Code: Select all
<a href="javascript:jsopen('/path/to/a/file.php')">Link</a>)But if I create the following file:
Code: Select all
<!--
function jsopen(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=425,height=250');");
}
// -->Code: Select all
<script language='JavaScript' src='js.js' type='text/javascript'>Can anyone tell me where I'm going wrong?
Thanks for your time.