![]() |
How to check whether javascript is enable or disable in client browser ? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: How to check whether javascript is enable or disable in client browser ? (/showthread.php?tid=15111) |
How to check whether javascript is enable or disable in client browser ? - El Forum - 01-27-2009 [eluser]Kotzilla[/eluser] i used noscript tag to remind user if client disable javascript on browser so, it's possible to show only noscript tag and disable form in page ? the way i do is disable from document by css and enable tag to warn client if JS is disable. i wanna know it's a right way to do or have any idea you can sharing. thank's for comment :lol: How to check whether javascript is enable or disable in client browser ? - El Forum - 01-27-2009 [eluser]Phil Sturgeon[/eluser] That's right. To show a message to users with no JavaScript, use <noscript>. To show messages to users who do have JavaScript, hide it with CSS then show it with JS. This of course means if they have no JS and no CSS it will show anyway, so if you are really worried about that put the message content in a different file and use AJAX to show it. However that would only work if they are on a browser that supports AJAX calls, at might not show even if they do have JavaScript. None of it is straight forward... :down: How to check whether javascript is enable or disable in client browser ? - El Forum - 01-27-2009 [eluser]RS71[/eluser] Hrmm I'm not sure if this would work correctly or even if it would suit your needs but: If you were to log an user in, maybe you can have a hidden input set to 0 by default. If JavaScript is enabled, you'd have it change the value to 1 or something on pageload. So when the form is submitted you can set a session variable to tell if that user has Javascript on. Not sure if this would work as well but: Sort of the same idea but maybe you can have the link leading to the form set to "form/add/" by default and have JavaScript change it to "form/add/js/" on pageload. Or maybe have AJAX in the background go to a page that sets a 'javascript' session variable to 1 or something. Not sure if any of these work and all would need to be set before the form page but... who knows heh I'm not too familiar with JavaScript so I can't be of much help. Good luck mate, RS71 How to check whether javascript is enable or disable in client browser ? - El Forum - 04-12-2010 [eluser]Costos[/eluser] You can't check from php if a browser has javascript enable or not |