[Javascript] Javascript detection

tedd tedd at sperling.com
Tue Jan 2 14:46:00 CST 2007


At 3:17 PM -0500 1/2/07, Matt Warden wrote:
>On 1/2/07, tedd <tedd at sperling.com> wrote:
>>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.
>
>But this is exactly what you are doing in your js detection scenario.
>You are passing a variable to the server side indicating whether js is
>available. To make this data usable, you *are* going to have to use
>cookies (unless you use PHP's phpsessionid querystring parameter).
>Otherwise, the variable will not be available in the $_SESSION. In
>other words, you have these options:
>
>1) Store the variable directly in cookies
>2) Use PHP sessions, which store a session id in a cookie and persist
>the variable on the server side
>3) Use PHP sessions, which append a phpsessionid querystring parameter
>to every URL and persis the variable on the server side
>4) Append the variable as a querystring parameter to every URL
>
>You'll note that 1 and 2 are nearly identical solutions, as are 3 and 4.

Matt:

Yes, I realize those -- however, there is one more way to pass 
variables from client-side to server-side, which is why I want to 
detect if javascript is enabled.

My methodology (correct or not) is first to detect if javascript is enabled.

If it isn't, then forget the enhancement.

If it is, then:

1. gather the values of the client-side variables for the first page;

2. on unload pass these values to an ajax routine;

3. which then passes them on to a php script;

4. which then places them into sessions;

5. This way the next page can read the session variables and continue 
with values that were set on the first page.

All of this is done without anything appearing in the url or in cookies.

What say you? Won't that work?

Thanks very much for your review.

tedd

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



More information about the Javascript mailing list