how to detect whether javascript is enabled or not on client machine

This is a discussion on how to detect whether javascript is enabled or not on client machine within the PHP Language forums, part of the PHP Programming Forums category; hi can any one help me to check that whether javsscript is enabled on client machine or not. if not ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-03-2005
vishal
 
Posts: n/a
Default how to detect whether javascript is enabled or not on client machine

hi

can any one help me to check that whether javsscript is enabled on
client machine or not. if not enabled then what steps should i take to
run my script that includes javascript.

thanks for your help in advance.....

Reply With Quote
  #2 (permalink)  
Old 03-03-2005
Daniel Tryba
 
Posts: n/a
Default Re: how to detect whether javascript is enabled or not on client machine

vishal <vishal_panjabi@yahoo.co.in> wrote:
> can any one help me to check that whether javsscript is enabled on
> client machine or not.


You can do that with.... javascript...

I'm thinking that a url with a meta/redirect of a couple of seconds and
a javascript redirect with a shorter timeout to different URLs will do
the trick.

> if not enabled then what steps should i take to
> run my script that includes javascript.


Display a message to the client telling them to turn on javascripa ( or
get a js enabled client), or you could write your scripts in such way
that javascript is optional.

All of this is offcourse OT in a php group since you are doing
clientside stuff.

Reply With Quote
  #3 (permalink)  
Old 03-03-2005
vishal
 
Posts: n/a
Default Re: how to detect whether javascript is enabled or not on client machine

thxs for information but i could not get what actually you want to say.
so please if you can write in some detail then i will be very thankful
to you.

Reply With Quote
  #4 (permalink)  
Old 03-03-2005
Christopher Stranex
 
Posts: n/a
Default Re: how to detect whether javascript is enabled or not on client machine

On your main page write the following:

<meta name="refresh" http-equiv="5;URL=nojavascript.php" />
<script language="javascript" type="text/javascript">
window.location = "javascript.php";
</script>

Reply With Quote
  #5 (permalink)  
Old 03-03-2005
vishal
 
Posts: n/a
Default Re: how to detect whether javascript is enabled or not on client machine

i have written this code and the page can not be displayed is message
but tell me how web server will know that javascript is not supported
on this client.

Reply With Quote
  #6 (permalink)  
Old 03-03-2005
Daniel Tryba
 
Posts: n/a
Default Re: how to detect whether javascript is enabled or not on client machine

vishal <vishal_panjabi@yahoo.co.in> wrote:
> i have written this code and the page can not be displayed is message


Huh?

> but tell me how web server will know that javascript is not supported
> on this client.


The server doesn't know untill you tell it (like in a session).

See http://tmp.tryba.nl/hasjs/


Reply With Quote
  #7 (permalink)  
Old 03-03-2005
Michael Fesser
 
Posts: n/a
Default Re: how to detect whether javascript is enabled or not on client machine

.oO(Daniel Tryba)

>vishal <vishal_panjabi@yahoo.co.in> wrote:
>
>> if not enabled then what steps should i take to
>> run my script that includes javascript.

>
>Display a message to the client telling them to turn on javascripa ( or
>get a js enabled client),


Annoying and not userfriendly.

>or you could write your scripts in such way
>that javascript is optional.


Much better.

Micha
Reply With Quote
  #8 (permalink)  
Old 03-03-2005
NSpam
 
Posts: n/a
Default Re: how to detect whether javascript is enabled or not on clientmachine

vishal wrote:
> hi
>
> can any one help me to check that whether javsscript is enabled on
> client machine or not. if not enabled then what steps should i take to
> run my script that includes javascript.
>
> thanks for your help in advance.....
>

Stateless Client Server environment. Simple answer you can't.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:47 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0