Topic: Refresh-tag in a new window... (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=9558" title="Pages that link to Topic: Refresh-tag in a new window... (Page 1 of 1)" rel="nofollow" >Topic: Refresh-tag in a new window... <span class="small">(Page 1 of 1)</span>\

 
flyer
Bipolar (III) Inmate

From: Helsingborg, Sweden
Insane since: Oct 2000

posted posted 11-19-2002 07:10

I'm using this code to load a new page in a new window
but the page loads in the same window. How should the target="_blank"
be used to fix this? :?

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<META HTTP-EQUIV="REFRESH" CONTENT="3; URL=reload.htm" target="_blank">
<title>Test</title>
</head>

</body>

</html>

kuckus
Bipolar (III) Inmate

From: Berlin (almost)
Insane since: Dec 2001

posted posted 11-19-2002 12:19

As far as I know you can't use that META tag to load a page into a new window, but a bit of JavaScript can do it:

setTimeout("window.open('reload.htm', '_blank');", 3000);

Put that into the BODY's onload attribute and it should do what you want.

flyer
Bipolar (III) Inmate

From: Helsingborg, Sweden
Insane since: Oct 2000

posted posted 11-20-2002 08:29

I tried your code but I get a "syntax errror.."
Hmm, what have I missed? :?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script language="JavaScript">
setTimeout(&quot;window.open('new.htm', '_blank');&quot;, 30);
</script>

</head>
<body>
A new page will shortly be loaded into a new window ...
</body>
</html>

kuckus
Bipolar (III) Inmate

From: Berlin (almost)
Insane since: Dec 2001

posted posted 11-20-2002 15:10

I just pasted the code you posted into a new file and is doing the job for me without complaining, so I assume you're not using IE 6 like I do... what you could try is assigning the timeout to a variable, like

var popup = setTimeout("window.open('new.htm', '_blank');", 30);

and see if that helps.

Also note that if you want the window to open after 3 seconds as you had it in the META tag, you'll have to say 3000 in JavaScript since it's counting milliseconds there.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu