[Javascript] Javascript detection

tedd tedd at sperling.com
Tue Jan 2 13:35:50 CST 2007


At 10:06 AM -0800 1/2/07, Paul Novitski wrote:
>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


Paul:

I appreciate your insight. I'm not trying to send the user one place 
if js is enabled or somewhere else if it's not. What I'm attempting 
to do is very trivial. I'm sure most will say "That was a real waste 
of bandwidth", if they knew. It's just a trivial progressive 
enhancement that in no way will interfere with the user in navigating 
the site.

But in my defense, I am learning how to pass variables from 
client-side to server-side without using cookies or obvious url's. 
But, to do that I need to know if js is enabled or not. I think I 
have that problem solved.

Now, how to get around not downloading a test page before presenting 
the "final" product I don't think is possible for one has to use js 
to see if it's there, or not, before passing that condition back to 
the server, right?

If you have a different method, I would love to hear it.

Thanks.

tedd

-- 
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com



More information about the Javascript mailing list