On Jun 29, 9:40 pm, "T.J. Crowder" <[EMAIL PROTECTED]> wrote:
> David,
>
> Ummm....if it doesn't support JavaScript, what kind of "variable" are
> you talking about?  Server-side?  'Cause if there is no client-side
> JavaScript, there are no client-side JavaScript variables.  Or perhaps
> you mean a cookie?

Given the rise in use of extensions like NoScript, it is likely that
even if some of the scripts in the page work, others won't if they
load from a different URI.  For example, I frequently allow scripts
from the site I'm visiting but don't allow Urchin tracker or google
analytics.


> You can definitely test whether JavaScript is enabled:  Have the page
> assume that it isn't, and then use JavaScript to change that
> assumption if it is.  The two main variations on this theme, off the
> top of my head, are:

That will probably work a good percentage of the time but it isn't
foolproof.  It may also be that the detection method itself failed.


> 1. Have a page that's fully-functional without JavaScript, but gets
> "spruced up" by JavaScript if it's enabled.  No "detection" per se is
> required, it's just that the sprucing up won't happen if the client
> doesn't have JavaScript.

Or if the javascript fails to execute properly.


> 2. Have a small intro page that redirects to a version of your page
> that doesn't use JavaScript if JavaScript isn't enabled, or to a
> version that does if it is.  You can easily do that by having
> JavaScript trigger a page load (by setting location.href) immediately,
> and having a meta refresh fallback that happens after a pause (e.g.,
> if the JavaScript thing hasn't happened).

Unless the meta refresh has been disabled too.


> In either case, if you like you can set a cookie to remember whether
> JavaScript is loaded for subsequent page loads (have the page set the
> cookie to "not enabled", and set it to "enabled" via JavaScript in the
> page), although if the browser supports JavaScript the user can change
> whether it's enabled between page loads, so your cookie can get out of
> date.  Users don't typically do that, of course.

They do, using extensions like NoScript, and they may also disable
cookies too.  The usual strategy for web sites is to make them
functional without scripting, then tart them up with script.  Some
sites also give visitors subtle hints that scripting would allow them
better functionality.


--
Rob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to