code_junkie

possibility of jQuery document ready() function taking a very long time to execute

Nov 13th, 2011
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. $(document).ready(function () {
  2. $("p").text("The DOM is now loaded and can be manipulated.");
  3. });
  4.  
  5. <script type="text/javascript">
  6.  
  7. var _gaq = _gaq || [];
  8. _gaq.push(['_setAccount', 'UA-XXXXX-X']);
  9. _gaq.push(['_trackPageview']);
  10.  
  11. (function() {
  12. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  13. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  14. (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
  15. })();
  16.  
  17. </script>
  18.  
  19. $(document).ready(function()
  20. {
  21. setTimeOut(function()
  22. {
  23. // Your code comes here
  24. }, 0); // We don't really need any delay
  25. });
Add Comment
Please, Sign In to add comment