E
E
eldar_web2015-05-27 21:33:29
Ruby on Rails
eldar_web, 2015-05-27 21:33:29

Why doesn't javascript get turned on in Rails when rendering, but turns on after page reload?

Even the simplest:

$(document).ready(function(){
alert()
});
--- does not work after rendering to another page, but works after page refresh.
What's the matter, how to solve the problem?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Viktor Vsk, 2015-05-27
@viktorvsk

Turbolinks

A
Anatoly Zhukov, 2015-05-28
@Skuayer

with turbolinks I use
$(document).bind('page:change', function () {
....
});

A
Anton Misyagin, 2015-05-28
@sunnmas

rusrails.ru/working-with-javascript-in-rails#sobyt...
Try

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question