Turbolinks prevents normal $(document).ready() events from firing on all page visits besides the initial load, as discussed here and here. None of the solutions in the linked answers work with Rails 5, though. How can I run code on each page visit...
I'm trying to make a JS snippet work in a concrete page with Rails 4 and Turbolinks. I've tried with the standard solution:  <script type="text/javascript">      var ready = function() {         // Bla bla     };      $(document...
I'm building my first Ruby on Rails application and I tried to create an animated navigation bar. I'm using jQuery and turbolink.  This is my application.js (under /app/assets/javascripts)  $(document).ready(function(){   $("#nav").ho...
I have a Javascript, which should work on $(document).ready but it won't, because I also have to use turbolinks.  Is there a way to disable it for this script? Or at least, is there a way to disable it for the view, I want my script to work on?...
I have the following:  $ ->     $('[data-provider="summernote"]').each ->       $(this).summernote         height: 300   And this works, however, I would like to make it TurboLinks 5 friendly.  So I tried the following:  $ ->...
in my Rails app I am loading Facebook plugin page, but because of turbolinks it doesnt load each page (only sometimes). I tried this script on this page , but now it never loads. What did I do?  I created facebook.coffee with this script:  $ ->...
I am integrating a front end html theme with a Laravel app and I am running into an issue with turbolinks not allowing Javascript to append div classes. This is causing the background images to only be displayed on refresh.   <div class="intro...
There's a template in my rails application that doesn't execute the javascript code the first time when it is loaded by clicking on a link in my home page. It only happens when it's accessed from the link and only the first time. I don...
I am using turbolinks 5 beta 1 and for some specific pages I want to load an external javascript file.  In my example I have a contacts page where I want to display a map by loading google maps api. It should not be loaded when accessing the root pag...
Javascript code like this  document.addEventListener("turbolinks:load", function() {   $("p#hide_if_js").hide(); });   is working fine with turbolinks when I click between pages or use the browser back button. However, when I refresh...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.