...

View Full Version : Opening html file into new window



allyson
07-04-2002, 04:41 AM
Hi

I am still having problems with this script. I know it's a simple problem, but I just
can't find the solution. When the user clicks on the arrow, the frameset should close,
and entry.htm should be loaded. Have a look at the website so far,
http://homepages.ihug.co.nz/~usateden/panacea/frameset/


<script language="javascript">

function back() {
window.open('../entry.htm');
window.top.close();
}
</script>
</head>

<body background="bg.GIF" bgproperties="fixed">
<div align="right">

<table border="0" cellpadding="0" width="90%">
<tr>
<td width="100%"><p align="left"><a href="java script:back();"><img
src="backarrow.gif"


Can anyone help with this please?

bye
Allyson

glenngv
07-04-2002, 04:48 AM
when i clicked the arrow, it says 'Object expected'

try to rename your function back() to something else. back() is a reserved method

scriptasylum
07-04-2002, 04:49 AM
Well, you've got a problem there. Unless you've opened the window WITH javascript, you can't close it without getting some type of warning (usually. some browsers dont follow this).

Your current function:

function back() {
window.open('../entry.htm');
window.top.close();
}

Try something like this instead:

function back() {
top.location.href="../entry.htm";
}



try to rename your function back() to something else. back() is a reserved method

yeah, that too :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum