Welcome to WebmasterWorld Guest from

Forum Moderators: incrediBILL

Message Too Old, No Replies

Redirecting index page after click that opens new window



11:00 am on Jul 11, 2012 (gmt 0)


First post, awesome site, thanks for any ideas.

Have been out of web site bus. for a few years and just getting back in.

Forgot alot of things, unfortuneately, and browsers have changed so things a bit different now.

I'm trying to redirect users of the index page after they click on a link that accepts the terms of service and by which a new window is launched.

So a seperate new window opens with (target="_blank") and meanwhile tyring to get original index page to redirect to another page within the site after click.

Doc type is - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

Thanks for any help...


9:09 pm on Jul 11, 2012 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

I'm going to go way out on a limb* and say it can't be done with HTML alone. (I assume that's what you had in mind, since this is the HTML forum.) You're looking at javascript, cookies, something simple in php... lotsa possibilities.

Oh, and the DTD for 4.01 Transitional should say
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Look up "quirks mode" for dreadful things that can happen if you leave off a syllable.

* If only because it will prod someone else to say "Now what disinformation is she spreading?" and rush in with the correct details :)


9:20 pm on Jul 11, 2012 (gmt 0)


Yeah, for the doc type I just copied what was in the code source.

I figured in was probably a javascript solution, but thought I would post here first since it thought maybe someone had some ideas.

So you have ideas for the code..

I'll post in the javascript forum...


10:50 pm on Jul 11, 2012 (gmt 0)

WebmasterWorld Senior Member swa66 is a WebmasterWorld Top Contributor of All Time 10+ Year Member

You can do this without javascript.

Easiest solution would be to test server side if a e.g. a cookie is present and send them to the accept "form", set the cookie when they accepted.

Testing for a cookie and redirection can even be done in an apache config/.htaccess using mod_rewrite. The "form" doesn't need to process much just set the cookie, and that too can be done using mod_rewrite

So you can get it done with just mod_rewrite and a few static pages without scripting at all.


12:04 am on Jul 12, 2012 (gmt 0)


Thank you very much for your reply and idea..

I'll have to say this is awesome too, the only thing is, everything you mention, is something I don't have experience in...

but I'm sure it's very effective, would need to get background on alot of what you talk about...

For my website design I'm using NetObjects Fusion 9. Actually got the newer version 12, but even that seems a little much for me right now. I used Fusion 9 back in 2006 and was away from everything for the last few years, so at least I know my way around that.

I use notepad to insert headings, titles and javascript into the finished fusion pages.


10:02 pm on Jul 11, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Yes, JavaScript.

if (window.opener)
window.opener.document.location.href = url;
/*opener is closed, deal with it*/


10:16 pm on Jul 11, 2012 (gmt 0)


That's awesome, thank you very much..

I'll give it a try..!


12:36 am on Jul 12, 2012 (gmt 0)


Just wondering, do I put that script after, just say the heading, by itself, or does need to be connected to "enter" button on the index page.

Guess I enlcose the script between -

<script type="text/javascript" >


or would it be




12:50 am on Jul 12, 2012 (gmt 0)

yeah, so I guess I'm not doing something right.

put the script in the page and not much happened, clicked on the enter button, the one page came up in a new window, but the index page remained, did not redirect the url I put in.


9:19 pm on Jul 12, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

On which page is the Enter button?
I might have misunderstood what you wanted as that script was to redirect the initial page by a script running in the page that is opened.
If your button is on the page you want to redirect you just need
document.location.href = url;
and a onclick event on your button to call that.
Maybe if you post the relevant bit of your current code someone can give you the exact change required


10:01 pm on Jul 12, 2012 (gmt 0)


Thanks, yes the button is on the page I want to redirect.

After the enter button is click, a seperate page launches with target blank, while the index page remains as it was when first accessed.

So after the the button is clicked, I'm trying to get the index page to redirect rather than just remaining as the index page.


10:35 pm on Jul 12, 2012 (gmt 0)


Here's the code for the click button. May look a little funky as this is the code that NetOjects Fusion generates.

So after somone clicks on the - CONTINUE - a page is launched, then I'm trying to redirect to a new page in the site with the original index page.



<td colspan="5" width="693" class="TextObject" style="background-color: rgb(255,255,0);">
<p><span style="font-family: Impact, 'Arial Black', 'Helvetica Bold', Charcoal, Sans-serif; font-size: 60pt; color: rgb(0,153,255);">&nbsp;&nbsp;<A STYLE="text-decoration:none" href="http://urlgoeshere.com/html/4.html" target="_blank"><span style="color: rgb(0,153,255);">CONTINUE</a></span></p>



2:33 pm on Jul 13, 2012 (gmt 0)

Yeah, so I guess I should have asked the original question as -

How would I trigger 2 events when clicking button on index page.

1st event - launch new window with target blank (this is working)

2nd event - redirect index page to another page in site.

I am really trying to figure this out myself, with help of what everyone has already mentioned, not quite there yet...



2:54 pm on Jul 13, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Set the button to execute a function on the page that handles both tasks:

function myFunction() {
window.location = 'http://www.example.com/';


3:19 pm on Jul 13, 2012 (gmt 0)


Thank you very much, I'll give it a try...


8:25 pm on Jul 13, 2012 (gmt 0)

Well, I guess I'm not quite as good as I would hope to be in using these helpful ideas.

Can't seem to incorporate what has been suggested to me in the code I have above...

I'm going to keep trying...

Featured Threads

Hot Threads This Week

Hot Threads This Month