[Javascript] Javascript detection

Paul Novitski paul at juniperwebcraft.com
Tue Jan 2 12:06:02 CST 2007


At 1/2/2007 08:57 AM, tedd wrote:
>The following Javascript detection link works for all browsers 
>provided by BrowerCam.
>
>http://sperling.com/js_detect1


Tedd,

And then, of course, it may not be the presence of JavaScript you 
need to detect but rather support for the DOM -- I assume that the 
reason you want to check for javascript is to see whether or not your 
client-side scripts will run.  I suggest you include a check for 
document.getElementById or another DOM method that your scripts depend on.

Downloading a test page before each real page will slow down the 
browsing experience, but perhaps not very noticeably on a fast connection.

I'm guessing that what you're doing is establishing an architecture 
in which PHP downloads different page content depending on whether or 
not javascript is present.  That implies that the javascript version 
of a page will depend on javascript running in order not to 
break.  To be as thorough as possible, since a user can disable 
javascript at any time while perusing your site, I guess you'd need 
to test for js before every page.  That still wouldn't prevent the 
current page from breaking when the user disables scripting, so I 
recommend that you keep at least your hyperlinks functional in the 
absence of scripting so folks can navigate to another page, 
restarting the process in non-js mode.

Regards,
Paul  




More information about the Javascript mailing list