Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking for JAVAScript

Status
Not open for further replies.

rubrink

Programmer
Mar 5, 2001
1
US
Is there any way to check if a user has JAVAScript turned off, and if they do to send them to a different page?

 
Yes, but obviously not using javascript. Make your first page a page with a single line of javascript that redirects to the real first page using location='wherever.html'.

Then put this line in the head section of your document under the script closing tag:

<meta http-equiv=refresh content='4;url=noscript.html'>

The value 4 is a number of seconds before the page 'refreshes' to the new url. Javascript enabled browsers will execute the javascript location command and redirect before the meta tag kicks in. You should actually be alright on a value of just one second though, I just like to be sure...

Extra tedious bit:
Apparrently some people browse the web with 'stripped down browsers' and very very old browsers that don't understand meta-tags. I'm not really in favour of catering for these annoying types of people(!), but if you really have to be sure, put a single image in the initial page that's big enough not to download until the location has changed, and make it an obvious link that a user can click on to be directed to the no script page. That way you'll ensure that you get something for everyone.

Matt.

 
Yes, but obviously not using javascript. Make your first page a page with a single line of javascript that redirects to the real first page using location='wherever.html'.

Then put this line in the head section of your document under the script closing tag:

<meta http-equiv=refresh content='4;url=noscript.html'>

The value 4 is a number of seconds before the page 'refreshes' to the new url. Javascript enabled browsers will execute the javascript location command and redirect before the meta tag kicks in. You should actually be alright on a value of just one second though, I just like to be sure...

Extra tedious bit:
Apparrently some people browse the web with 'stripped down browsers' and very very old browsers that don't understand meta-tags. I'm not really in favour of catering for these annoying types of people, who probably make up 0.001 percent of the browsing population, but if you really have to be sure, put a single image in the initial page that's big enough not to download until the location has changed, and make it an obvious link that a user can click on to be directed to the no script page. That way you'll ensure that you get something for everyone.

Matt.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top