Re: [PHP] Javascript detection , working version
At 9:32 PM -0800 1/11/07, Jürgen Wind wrote: tedd wrote: index.php, jstest110.php) , make it one. ok ---8--- It would be cool if I could send js value via a POST instead of GET-- can that be done? have a look http://149.222.235.16/jstest/70112/index.php ( POST version ) tedd PS: I read somewhere that using noscript is not recommended. any info? Yes, I knew I read it somewhere (my memory is not as good as it used to be). In the book PPK on Javascript (most excellent book btw http://www.quirksmode.org/book/), on page 57 he says Therefore, it's best not to use the noscript tag at all. I leave it to you to buy the book to find out why. But basically, browsers that don't use javascript don't see that tag and those that do, don't use it. As such, the tag has no real use. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
That book is so cool! =P Anyways, it said that browsers with Javascript, but not a recent enough Javascript would not display the Noscript. On 1/13/07, tedd [EMAIL PROTECTED] wrote: At 9:32 PM -0800 1/11/07, Jürgen Wind wrote: tedd wrote: index.php, jstest110.php) , make it one. ok ---8--- It would be cool if I could send js value via a POST instead of GET-- can that be done? have a look http://149.222.235.16/jstest/70112/index.php ( POST version ) tedd PS: I read somewhere that using noscript is not recommended. any info? Yes, I knew I read it somewhere (my memory is not as good as it used to be). In the book PPK on Javascript (most excellent book btw http://www.quirksmode.org/book/), on page 57 he says Therefore, it's best not to use the noscript tag at all. I leave it to you to buy the book to find out why. But basically, browsers that don't use javascript don't see that tag and those that do, don't use it. As such, the tag has no real use. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
Ruben Rubio Rey wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 A good way to detect if javascript exists is (cross-browser, cross-platform): You try to load javascript_exists.htm. - javascript_exists.htm: noscript meta http-equiv=refresh content=0; URL=javascript_not_actived.htm /noscript html ... Javascript is actived!! /html - javascript_not_actived.htm: html ... Javascript is *NOT* actived!! /html -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFpzemIo1XmbAXRboRAirXAKCo8LlqI0gv/7+Kfs7L6EHJGRdN3QCgo530 1YwBznS0B8p3KSFVCVcyyfc= =DjZ8 -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- View this message in context: http://www.nabble.com/Javascript-detection-tf2905451.html#a8297155 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
Ruben Rubio Rey wrote: A good way to detect if javascript exists is (cross-browser, cross-platform): You try to load javascript_exists.htm. - javascript_exists.htm: noscript meta http-equiv=refresh content=0; URL=javascript_not_actived.htm /noscript html ... Javascript is actived!! /html - javascript_not_actived.htm: html ... Javascript is *NOT* actived!! /html obviously the most simple and logical solution ;) p.s.: sorry for the previous empty post(hit wrong botten) Juergen -- View this message in context: http://www.nabble.com/Javascript-detection-tf2905451.html#a8297234 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
tedd wrote: index.php, jstest110.php) , make it one. ok ---8--- It would be cool if I could send js value via a POST instead of GET-- can that be done? have a look http://149.222.235.16/jstest/70112/index.php ( POST version ) tedd PS: I read somewhere that using noscript is not recommended. any info? have fun, Jürgen -- View this message in context: http://www.nabble.com/Javascript-detection-tf2905451.html#a8292741 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 A good way to detect if javascript exists is (cross-browser, cross-platform): You try to load javascript_exists.htm. - javascript_exists.htm: noscript meta http-equiv=refresh content=0; URL=javascript_not_actived.htm /noscript html ... Javascript is actived!! /html - javascript_not_actived.htm: html ... Javascript is *NOT* actived!! /html -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFpzemIo1XmbAXRboRAirXAKCo8LlqI0gv/7+Kfs7L6EHJGRdN3QCgo530 1YwBznS0B8p3KSFVCVcyyfc= =DjZ8 -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
Curt Zirzow-2 wrote: On 1/1/07, Jürgen Wind [EMAIL PROTECTED] wrote: well, no cute css, but (hopefully) working - here is my quick dirty version : http://149.222.235.16/public/ I dont understand the point. Curt, sorry, i should have posted the original code (it's merely js/html/browser related, not php) http://149.222.235.16/public/index.html (20070102) : script !--// index.html 20070102 D=new Date() location.href='jstest.php?js=okt='+D.getTimezoneOffset() //--/script meta http-equiv='refresh' content='0;url=jstest.php?js=no' as i already said elsewhere in the thread: it was just a quickdirty hack, as tedds link didn't work. But Roman made a good point: Out of curiosity, can you guarantee the Javascript redirect will always occur before the meta redirect when Javascript is enabled? Otherwise you have a race condition. so here is what's new in http://149.222.235.16/public/index.php (20070110) : 8 noscript meta http-equiv='refresh' content='0;url=jstest110.php?js=no' ?php /*** or put here your complete page for browsers with js disabled ***/ ? /noscript -- View this message in context: http://www.nabble.com/Javascript-detection-tf2905451.html#a8256985 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
At 4:54 AM -0800 1/10/07, Jürgen Wind wrote: 8 [source of index] noscript meta http-equiv='refresh' content='0;url=jstest110.php?js=no' ?php /*** or put here your complete page for browsers with js disabled ***/ ? /noscript Nice -- now instead of two different pages (i.e., index.php, jstest110.php) , make it one. Here's my solution: http://www.sperling.com/js_detect3/ ?php if (!isset($_GET['js'])) { echo(script type='text/javascript'location.href='index.php?js=ok';/script); } else { $js = $_GET['js']; if($js != ok) { $js = no; } } ? Now, depending upon the value of $js, do whatever. It would be cool if I could send js value via a POST instead of GET-- can that be done? tedd PS: I read somewhere that using noscript is not recommended. -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
index.php, jstest110.php) , make it one. no, it was just a proof of concept It would be cool if I could send js value via a POST instead of GET-- can that be done? should be possible with some onload/xhtmlrequest tedd PS: I read somewhere that using noscript is not recommended. hmm, any links or buzzwords for google? -- View this message in context: http://www.nabble.com/Javascript-detection-tf2905451.html#a8267553 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
At 9:55 PM +0100 1/2/07, Satyam wrote: - Original Message - From: Robert Cummings [EMAIL PROTECTED] To: Jürgen Wind [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Tuesday, January 02, 2007 8:57 PM Subject: Re: [PHP] Javascript detection , working version On Tue, 2007-01-02 at 11:32 -0800, Jürgen Wind wrote: Robert Cummings wrote: Out of curiosity, can you guarantee the Javascript redirect will always occur before the meta redirect when Javascript is enabled? Otherwise you have a race condition. Cheers, Rob. i have no idea, it is just a quickdirty hack, i'm no js expert ;) the js part is rather fast, maybe a little delay or window.write is neccessary after the redirect? No, you always want the javascript to run first. The question is whether a meta redirect could ever occur before the javascript redirect. If it can then occasionally you may get javascript not detected since the meta redirect would occur when in fact javascript is enabled. Cheers, Rob. -- What I usually do is to make the entry page the one that would be used without JavaScript and branch only if JavaScript is present. Satyam To all: What I am doing is not branching to any other page but rather if js is present then I use the js enhancement and if not, then it's not there to be used. In either case, the page works. It's only an enhancement. In either case, there's no race condition. tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
you additionaly can surround the meta redirect with noscript tags: script !--// index.html D=new Date() location.href='jstest.php?js=okt='+D.getTimezoneOffset() //--/script noscript meta http-equiv='refresh' content='0;url=jstest.php?js=no' /noscript tedd wrote: At 9:55 PM +0100 1/2/07, Satyam wrote: - Original Message - From: Robert Cummings [EMAIL PROTECTED] To: Jürgen Wind [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Tuesday, January 02, 2007 8:57 PM Subject: Re: [PHP] Javascript detection , working version On Tue, 2007-01-02 at 11:32 -0800, Jürgen Wind wrote: Robert Cummings wrote: Out of curiosity, can you guarantee the Javascript redirect will always occur before the meta redirect when Javascript is enabled? Otherwise you have a race condition. Cheers, Rob. i have no idea, it is just a quickdirty hack, i'm no js expert ;) the js part is rather fast, maybe a little delay or window.write is neccessary after the redirect? No, you always want the javascript to run first. The question is whether a meta redirect could ever occur before the javascript redirect. If it can then occasionally you may get javascript not detected since the meta redirect would occur when in fact javascript is enabled. Cheers, Rob. -- What I usually do is to make the entry page the one that would be used without JavaScript and branch only if JavaScript is present. Satyam To all: What I am doing is not branching to any other page but rather if js is present then I use the js enhancement and if not, then it's not there to be used. In either case, the page works. It's only an enhancement. In either case, there's no race condition. tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- View this message in context: http://www.nabble.com/Javascript-detection-tf2905451.html#a8250856 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
On 1/1/07, Jürgen Wind [EMAIL PROTECTED] wrote: well, no cute css, but (hopefully) working - here is my quick dirty version : http://149.222.235.16/public/ I dont understand the point. Curt, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
tedd, plz no personal mail, i like better to discuss things in the forum and thus hear other meanings and experiences. Your solution was very simple and worked very well. tx, i always try to keep things logical and as simple as possible ;) this is just a quick example to show how to bring info gathered by js back to the php application (and possibly store it in a session for later use). Using the query string is just one way and can also be used in combination with loading some css.php or some such. Setting a cookie may be another option. Happy coding ;) -- View this message in context: http://www.nabble.com/Javascript-detection-tf2905451.html#a8127911 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
On Tue, 2007-01-02 at 10:06 -0800, Jürgen Wind wrote: tedd, plz no personal mail, i like better to discuss things in the forum and thus hear other meanings and experiences. Your solution was very simple and worked very well. tx, i always try to keep things logical and as simple as possible ;) this is just a quick example to show how to bring info gathered by js back to the php application (and possibly store it in a session for later use). Using the query string is just one way and can also be used in combination with loading some css.php or some such. Setting a cookie may be another option. Happy coding ;) Out of curiosity, can you guarantee the Javascript redirect will always occur before the meta redirect when Javascript is enabled? Otherwise you have a race condition. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
Robert Cummings wrote: Out of curiosity, can you guarantee the Javascript redirect will always occur before the meta redirect when Javascript is enabled? Otherwise you have a race condition. Cheers, Rob. i have no idea, it is just a quickdirty hack, i'm no js expert ;) the js part is rather fast, maybe a little delay or window.write is neccessary after the redirect? -- View this message in context: http://www.nabble.com/Javascript-detection-tf2905451.html#a8129234 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
On Tue, 2007-01-02 at 11:32 -0800, Jürgen Wind wrote: Robert Cummings wrote: Out of curiosity, can you guarantee the Javascript redirect will always occur before the meta redirect when Javascript is enabled? Otherwise you have a race condition. Cheers, Rob. i have no idea, it is just a quickdirty hack, i'm no js expert ;) the js part is rather fast, maybe a little delay or window.write is neccessary after the redirect? No, you always want the javascript to run first. The question is whether a meta redirect could ever occur before the javascript redirect. If it can then occasionally you may get javascript not detected since the meta redirect would occur when in fact javascript is enabled. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
At 2:06 PM -0500 1/2/07, Robert Cummings wrote: On Tue, 2007-01-02 at 10:06 -0800, Jürgen Wind wrote: tedd, plz no personal mail, i like better to discuss things in the forum and thus hear other meanings and experiences. Your solution was very simple and worked very well. tx, i always try to keep things logical and as simple as possible ;) this is just a quick example to show how to bring info gathered by js back to the php application (and possibly store it in a session for later use). Using the query string is just one way and can also be used in combination with loading some css.php or some such. Setting a cookie may be another option. Happy coding ;) Out of curiosity, can you guarantee the Javascript redirect will always occur before the meta redirect when Javascript is enabled? Otherwise you have a race condition. Cheers, Rob. Rob: That's a good point -- even if a delay was added it's not certain that it wouldn't experience a race issue. And the longer the delay, the more problems you have with the user experience. Perhaps a token scheme, like prohibiting duplicate from submissions, might work. tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
On Tue, 2007-01-02 at 15:24 -0500, tedd wrote: Rob: That's a good point -- even if a delay was added it's not certain that it wouldn't experience a race issue. And the longer the delay, the more problems you have with the user experience. Perhaps a token scheme, like prohibiting duplicate from submissions, might work. Well I don't know if there is a race condition. I don't know enough about meta redirects and javascript execution to know if a race condition exists at all. That was why I did my solution the way I did it, I know for a fact there is no race condition in it :) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
- Original Message - From: Robert Cummings [EMAIL PROTECTED] To: Jürgen Wind [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Tuesday, January 02, 2007 8:57 PM Subject: Re: [PHP] Javascript detection , working version On Tue, 2007-01-02 at 11:32 -0800, Jürgen Wind wrote: Robert Cummings wrote: Out of curiosity, can you guarantee the Javascript redirect will always occur before the meta redirect when Javascript is enabled? Otherwise you have a race condition. Cheers, Rob. i have no idea, it is just a quickdirty hack, i'm no js expert ;) the js part is rather fast, maybe a little delay or window.write is neccessary after the redirect? No, you always want the javascript to run first. The question is whether a meta redirect could ever occur before the javascript redirect. If it can then occasionally you may get javascript not detected since the meta redirect would occur when in fact javascript is enabled. Cheers, Rob. -- What I usually do is to make the entry page the one that would be used without JavaScript and branch only if JavaScript is present. Satyam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
On Tue, 2007-01-02 at 21:55 +0100, Satyam wrote: - Original Message - From: Robert Cummings [EMAIL PROTECTED] To: Jürgen Wind [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Tuesday, January 02, 2007 8:57 PM Subject: Re: [PHP] Javascript detection , working version On Tue, 2007-01-02 at 11:32 -0800, Jürgen Wind wrote: Robert Cummings wrote: Out of curiosity, can you guarantee the Javascript redirect will always occur before the meta redirect when Javascript is enabled? Otherwise you have a race condition. Cheers, Rob. i have no idea, it is just a quickdirty hack, i'm no js expert ;) the js part is rather fast, maybe a little delay or window.write is neccessary after the redirect? No, you always want the javascript to run first. The question is whether a meta redirect could ever occur before the javascript redirect. If it can then occasionally you may get javascript not detected since the meta redirect would occur when in fact javascript is enabled. Cheers, Rob. -- What I usually do is to make the entry page the one that would be used without JavaScript and branch only if JavaScript is present. Yeah, that was what I did :) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
At 3:39 PM -0500 1/2/07, Robert Cummings wrote: On Tue, 2007-01-02 at 15:24 -0500, tedd wrote: Rob: That's a good point -- even if a delay was added it's not certain that it wouldn't experience a race issue. And the longer the delay, the more problems you have with the user experience. Perhaps a token scheme, like prohibiting duplicate from submissions, might work. Well I don't know if there is a race condition. I don't know enough about meta redirects and javascript execution to know if a race condition exists at all. That was why I did my solution the way I did it, I know for a fact there is no race condition in it :) Cheers, Rob. Rob: I haven't had a chance to check out your solution, but I will. Many thanks. tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
- Original Message - From: Robert Cummings [EMAIL PROTECTED] What I usually do is to make the entry page the one that would be used without JavaScript and branch only if JavaScript is present. Yeah, that was what I did :) Cheers, Rob. -- Sorry, it seems I missed it. Satyam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
Satyam wrote: What I usually do is to make the entry page the one that would be used without JavaScript and branch only if JavaScript is present. Satyam yes, that's the best solution, updated version: http://149.222.235.16/jstest/ -- View this message in context: http://www.nabble.com/Javascript-detection-tf2905451.html#a8132106 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
Robert Cummings wrote: Out of curiosity, can you guarantee the Javascript redirect will always occur before the meta redirect when Javascript is enabled? Otherwise you have a race condition. Cheers, Rob. yes, you where right (i noticed some problems with opera) updated version: http://149.222.235.16/jstest/ -- View this message in context: http://www.nabble.com/Javascript-detection-tf2905451.html#a8132150 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
that's why i prefer discussing here in the forum, we benefit from the experiences of each other :) updated version: http://149.222.235.16/jstest/ -- View this message in context: http://www.nabble.com/Javascript-detection-tf2905451.html#a8132203 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
well, no cute css, but (hopefully) working - here is my quick dirty version : http://149.222.235.16/public/ -- View this message in context: http://www.nabble.com/Javascript-detection-tf2905451.html#a8118787 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript detection , working version
At 4:54 PM -0800 1/1/07, =?UTF-8?Q?J=C3=BCrgen_Wind?= wrote: well, no cute css, but (hopefully) working - here is my quick dirty version : http://149.222.235.16/public/ -- Well, it's cute enough for me ! It works on every browser that BrowserCam has -- hell, I can't even get my web site to do that. Much thanks. tedd PS: Too bad my email doesn't translate your name right. -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php