homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

Redirecting index page after click that opens new window

Msg#: 4474559 posted 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...



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

Msg#: 4474559 posted 9:09 pm on Jul 11, 2012 (gmt 0)

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 :)


Msg#: 4474559 posted 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...


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

Msg#: 4474559 posted 10:50 pm on Jul 11, 2012 (gmt 0)

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.


Msg#: 4474559 posted 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.


WebmasterWorld Senior Member 5+ Year Member

Msg#: 4474559 posted 10:02 pm on Jul 11, 2012 (gmt 0)

Yes, JavaScript.

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


Msg#: 4474559 posted 10:16 pm on Jul 11, 2012 (gmt 0)


That's awesome, thank you very much..

I'll give it a try..!


Msg#: 4474559 posted 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




Msg#: 4474559 posted 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.


WebmasterWorld Senior Member 5+ Year Member

Msg#: 4474559 posted 9:19 pm on Jul 12, 2012 (gmt 0)

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


Msg#: 4474559 posted 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.


Msg#: 4474559 posted 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>



Msg#: 4474559 posted 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...



WebmasterWorld Senior Member 10+ Year Member

Msg#: 4474559 posted 2:54 pm on Jul 13, 2012 (gmt 0)

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

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


Msg#: 4474559 posted 3:19 pm on Jul 13, 2012 (gmt 0)


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


Msg#: 4474559 posted 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...

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved