M
M
Max2015-05-13 16:52:26
JavaScript
Max, 2015-05-13 16:52:26

How to check if JS is enabled in Rails?

Hello, tell me how to check if a user has JAvascript enabled in RoR?
There is a form that should be displayed if js does not work. And if it works, then the form appears in a pop-up window. Please help me make this happen.)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Grechushnikov, 2015-05-13
@maxprof

For rails, it doesn't matter. Make body class="no-js" and remove this class from the body in javascript. then make the form display:none, and for the form that is inside the .no-js class, make display:block;
and done

D
Denis Ineshin, 2015-05-13
@IonDen

The easiest way, as old as IE, is the noscript tag .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question