javascript - Rails 5: JQuery inside $(document).ready does not fire from page to page, only on reload -


this question has answer here:

edit: found issue answer here:

rails 4: how use $(document).ready() turbo-links


as title says, have jquery @ bottom of application.js file inside rails 5 app. i've noticed won't fire if i'm traveling page page. however, work if reload page i'm on.

just clear, application.js file:

#app/assets/javascripts/application.js ... rest of file. //= require_tree .  $( document ).ready(function() {   alert('test'); }); 

i won't alert @ if i'm clicking page page within app. again, alert fire if reload page i'm on.

any wonderful.

i guess should try changing $(document).ready() $(window).load().


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -