If you’re using Bootstrap 3.x to generate a remote link based modal, you’ll notice that re-clicking the same link does not re-request the content of the remote URL and instead just re-displays the same content from the previous load. This isn’t a great result in many cases (forms for new objects for instance). To resolve this issue do the following: $(document).ready(function(){ $('body').on('hidden.bs.modal', '.modal', function () { $(this).removeData('bs.modal'); }); }); This [...]
Read More
You may want to wait until all assets have loaded (such as images and certain JSON requests) prior to performing an action in JQuery. To do this, wrap your code in the following listener: $(window).load(function(){ }); This is different than what is typically done: $(document).ready(function(){ }); This allows us to wait until the DOM has successfully loaded before executing additional code, but does not wait for the additional assets.
Read More