This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > August 2004 > Javascript: history.back with conditions





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Javascript: history.back with conditions
James Brown

2004-08-26, 12:22 pm

Hi there.

I want to have a links on a page that takes a user forward and back through
a presentation but if they have dropped into the middle of the presentation
from another domain (search engine probably) then I want the 'back' link to
send them to the home page.

I can can do this is ASP/VB but it needs to be in javascript - can anyone
help me with this?

Regards

James Brown


Mick White

2004-08-26, 12:22 pm

Add the following (first) line to your javascript function:

if(!document.referrer){location.replace("startpage.html");return;}

Could be a problem, though. The user will not be able to sucessfully
bookmark page.
Mick

James Brown wrote:

> Hi there.
>
> I want to have a links on a page that takes a user forward and back through
> a presentation but if they have dropped into the middle of the presentation
> from another domain (search engine probably) then I want the 'back' link to
> send them to the home page.
>
> I can can do this is ASP/VB but it needs to be in javascript - can anyone
> help me with this?
>
> Regards
>
> James Brown
>
>

Sponsored Links


Copyright 2003 - 2009 forum4designers.com  Software forum  Computer Hardware reviews