Tuesday, August 19, 2014

jQuery $(document).ready () fires twice

At my client side there was an issue where jQuery carousel/slider was erratic (moving at fast pace).

After inspection I found that jQuery $(document).ready () was getting called twice which was initializing the carousel/slider twice. This was caused due to someone moving the markup (which had our page custom jquery) in the HTML to the head tag from the bottom of the page and forgetting to remove the old one.

For this reason jQuery $(document).ready () was being called twice.

No comments: