How to handle javascript turned off

Possible duplicate:
How to determine if JavaScript is disabled?

My first web application relies mostly on Javascript and an AJAX application.

Besides my login page, most pages rely on Javascript and Ajax when sending data to the server. I thought about this, if the user disables their javascript, then my application does not behave accordingly.

I used this code on my login page

<NOSCRIPT>
    Javascript is required to run this pages.  Please turn it on or ask help from techsupport if you dont know how to enable it
</NOSCRIPT>

Although I think this is not relevant, I used Spring MVC 2.5 and Jquery for the sake of information for everyone.

Any thoughts on how others can handle this scenario?

+3
source share
5 answers

, JavaScript. - , 10 .

<noscript> , JavaScript. , , ... JavaScript , JavaScript ( " jquery " )?

, , JavaScript (jQuery), . , , JavaScript.

+6

, -

<noscript>
    <meta http-equiv="refresh" content="url=/?nojs=true">
</noscript>

html, , - .

: (PHP )

if(isset($_GET['nojs']) && !isset($_SESSION['no_script']))
{
    $_SESSION['no_script'] = true; //Or cookie
}

, , session/cookie, JavaScript.

+4

javascript, , , . js. , , .

, javascript, , .

0

jquery, , .

, , , javascript. $('#login').attr('disabled',false);. javascript , .

div, , css, , JS .

, . , firebug, , 1,2,3. , , .ajax() cookie. . - , .

0

5! If web applications are heavily dependent on JavaScript, my suggestion is to include a tag <noscript>. You can then tell users how to enable it: www.enable-javascript.com

0
source

Source: https://habr.com/ru/post/1766713/


All Articles