Old 12-10-2006, 18:40   #1 (permalink)
5P4C3
Deathblow
 
5P4C3's Avatar
 
Join Date: Apr 2006
Location: Norway
Posts: 354
check if Javascript is activated

Is there a way to check if javascript is activated or not?
  Reply With Quote
Old 12-10-2006, 23:22   #2 (permalink)
d3mcfadden
Senior Member
 
d3mcfadden's Avatar
 
Join Date: Apr 2005
Location: -
Posts: 694
Send a message via AIM to d3mcfadden
<noscript> tag if javascript is not enabled you can let the user know that they need to enable it by placing content in noscript tags - this only displays if, well ya know - there is no script [capability]
  Reply With Quote
Old 13-10-2006, 06:28   #3 (permalink)
5P4C3
Deathblow
 
5P4C3's Avatar
 
Join Date: Apr 2006
Location: Norway
Posts: 354
Okey. I was more thinking of, doing it with php something lik if javascript is activated do action, else do another action.
  Reply With Quote
Old 13-10-2006, 06:36   #4 (permalink)
paulanthony
mingin dawg baitch
 
paulanthony's Avatar
 
Join Date: Apr 2004
Location: Belfast
Posts: 1,035
Send a message via MSN to paulanthony
you could do a redirect at the home page

window.location = "default.php?js=true"

<noscript><a href="default.php">Enter Website</a>

if you receive the variable then you know javascript is enabled.
__________________
  Reply With Quote
Old 13-10-2006, 06:37   #5 (permalink)
cam
vague™
 
cam's Avatar
 
Join Date: Mar 2004
Location: Glasgow
Posts: 5,365
I'd be interested to know why you want to know if JS is enabled. The majority of times you shouldn't know/care if the user does or not, by ensuring all your JS degrades gracefully. It's more a case of coding while making sure everything still works should JS not be available rather than actually knowing for sure. In answer to your question though, as far as I'm aware testing for JS availability is done purely on the client-side, not the server.
__________________
Random goodness at The Blog

  Reply With Quote
Old 13-10-2006, 06:37   #6 (permalink)
cam
vague™
 
cam's Avatar
 
Join Date: Mar 2004
Location: Glasgow
Posts: 5,365
Quote:
Originally Posted by paulanthony
you could do a redirect at the home page

window.location = "default.php?js=true"

<noscript><a href="default.php">Enter Website</a>

if you receive the variable then you know javascript is enabled.

I know you're just trying to answer his question, but that's a horrible idea
__________________
Random goodness at The Blog

  Reply With Quote
Old 13-10-2006, 07:46   #7 (permalink)
paulanthony
mingin dawg baitch
 
paulanthony's Avatar
 
Join Date: Apr 2004
Location: Belfast
Posts: 1,035
Send a message via MSN to paulanthony
Because?

It is possible to do server side detection of javascript through a third party component.

http://www.yocasa.org/
__________________
  Reply With Quote
Old 28-10-2006, 10:22   #8 (permalink)
Suigeneriz
Norwegian Viking™
 
Join Date: Oct 2006
Location: Norway
Posts: 55
injection?
  Reply With Quote
Old 29-10-2006, 15:30   #9 (permalink)
5P4C3
Deathblow
 
5P4C3's Avatar
 
Join Date: Apr 2006
Location: Norway
Posts: 354
I want it for example if javascript is not activated, the function wich was supoced to be there, will be replaced by something else wich does not require Javasxript.

Thanks paulanthony I'll check out that site.
  Reply With Quote
Old 30-10-2006, 08:58   #10 (permalink)
stickmus
hmmm...
 
stickmus's Avatar
 
Join Date: Jan 2004
Location: Yorkuk
Posts: 2,130
You should do it the other way round, modify the page with the javascript.
__________________
George Smith - a vain attempt to get higher on google for my name

  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8