Fóruns

Início » Liferay Portal » English » 3. Development

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
Akram MONCER
force user to enable javascript/cookies
15 de Maio de 2013 06:57
Resposta

Akram MONCER

Ranking: Regular Member

Mensagens: 106

Data de entrada: 25 de Setembro de 2012

Mensagens recentes

hi everyone

i created a liferay portlet, in which i use many JavaScript feature, the problem is if the user disable JavaScript and cookies in his browser all will be blocked.
so my question is how can i force user to enable javascript and cookies in his browser. or show a warning to the user that he have to activate them before he can d anything.

thanks
Subhash Pavuskar
RE: force user to enable javascript/cookies
15 de Maio de 2013 10:05
Resposta

Subhash Pavuskar

Ranking: Regular Member

Mensagens: 234

Data de entrada: 12 de Março de 2012

Mensagens recentes

As per my knowledge you can't enable or disable JavaScript on a browser using code. If browsers allow a web page to play with it's settings, it would be very vulnerable.
Whenever you perform validations on a web page, the best practice is to do a client side as well as server side check.

Have look

 1<html>
 2<head></head>
 3<body>
 4<h1>noscript example</h1>
 5<noscript>
 6    <h3>JavaScript is disabled! Please enable JavaScript in your web browser!</h3>
 7
 8    <style type="text/css">
 9        #main-content { display:none; }
10    </style>
11</noscript>
12
13<div id="main-content">
14    <h3>Browser already enabled JavaScript!</h3>
15</div>
16
17</body>
18</html>