3 ms·
Right, this is good--but are fears of mysteriously-breaking javascript depending on the ready event unfounded?
by angersock 13y ago
Right, this is good--but are fears of mysteriously-breaking javascript depending on the ready event unfounded?
- steveklabnik 13y agoBy 'the ready event' I'm assuming you mean the onload event. Those will break, you need to update them to listen to the 'page:ready' event instead. The Turbolinks README has everything you need to do to make your applications ready, if you choose to use it: https://github.com/rails/turbolinks#turbolinks https://github.com/rails/turbolinks#turbolinks
- breckenedge 13y agoIf you're using jquery, then there is already a gem for that: jquery-turbolinks (https://github.com/kossnocorp/jquery.turbolinks https://github.com/kossnocorp/jquery.turbolinks)
- mieko 13y agojquery-turbolinks as a drop-in fix worked great for my application. The only tweaks my own code required at that point were resources I assumed would die and be recreated on the next page load, like doubling up setInterval handles in domready.