PDA

View Full Version : Probably a stupid question but...


JackN
9 June 2004, 06:18 PM
In a web page, I want to use an Image with URL mapping to replace a snazzy JavaScript Menu, if JavaScript is turned off in the browser.

If JavaScript is turned off, then the test for navigator.javaEnabled() should return a boolean "False".

How the hell can I test that if JavaScript is turned off!?! The Script wouldn't even run then...

:confused:

Anybody have a solution for my problem, or a link to point me too?

JackN
9 June 2004, 06:21 PM
By the way, the server that this page will be on has PHP capability, so if there is a PHP way to test for JavaScript in the browser, before compiling to the page with its choice of image or menu script, I'm all ears!

;)

I don't know PHP well enough yet...

:D

JackN
9 June 2004, 06:29 PM
Or even a way to hide the image map behind the script in a HTML/CSS layer?

Whatever works! Help!

Biggles
9 June 2004, 06:30 PM
I don't know php at all, but I would be very surprised if you couldn't get the browser properties in it and check for java support.

Try this:
http://www.experts-exchange.com/Web/Web_Languages/PHP/Q_20995840.html

Biggles
9 June 2004, 06:34 PM
Also this:
http://groups.google.co.nz/groups?hl=en&lr=&ie=UTF-8&threadm=3e4a1f77_1%40news.tiscalinet.ch&rnum=1&prev=/groups%3Fq%3Dcheck%2Bjavascript%2Bsupport%2Bgroup:alt.comp.lang.php%26hl%3Den%26lr%3D%26ie%3DUTF-8%26group%3Dalt.comp.lang.php%26selm%3D3e4a1f77_1%2540news.tiscalinet.ch%26rnum%3D1

Biggles
9 June 2004, 06:35 PM
I would think the best way is probably a redirect to an index.php that takes an argument depending on if javascript is enabled or not. Then use a different redirect in the noscript tag to outside it. But I'm not an expert web designer so don't quote me on that. :)

JackN
9 June 2004, 06:46 PM
Ah yes... The < NOSCRIPT > tag...

That might actually get me somewhere!

Thanks man!

;)

Biggles
9 June 2004, 06:58 PM
I'd never heard of it before, myself. :)

JackN
10 June 2004, 12:38 AM
This seems to be what I need, and will be a lot less work than using PHP to test for it...

The NOSCRIPT Tag (http://www.w3schools.com/tags/tag_noscript.asp)

;)

JackN
10 June 2004, 11:07 AM
Yay! It works! Woo Hoo!

:D

C_Mon
10 June 2004, 02:52 PM
YAY!!:D
Now we can all be happy!

Biggles
10 June 2004, 03:07 PM
Always happy!

C_Mon
10 June 2004, 05:01 PM
Right! :rolleyes:

RubberEagle
11 June 2004, 02:19 AM
cool.... I would have put a javascript redirect to another page on the index page, but since someone actually thought of creating a <NOSCRIPT>-tag... :)