Advertisement
Guest User

Untitled

a guest
Apr 26th, 2012
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.15 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3.     <head>
  4.         <meta charset=utf-8>
  5.         <title></title>
  6.         <script>
  7.             var functions = [];
  8.         </script>
  9.     </head>
  10.    
  11.     <body>
  12.        
  13.         <!-- this part will be changed dynamically by the CMS -->
  14.             <script>
  15.                 functions.push(function() {
  16.                     if(typeof jQuery !== 'undefined') {
  17.                         alert('jQuery is defined');
  18.                     } else {
  19.                         alert('jQuery is undefined');
  20.                     }
  21.                 });
  22.  
  23.                 functions.push(function() {
  24.                     $(function() {
  25.                         alert('this one on DOM ready');
  26.                     });
  27.                 });
  28.             </script>
  29.         <!-- end of dynamically created part -->
  30.        
  31.        
  32.         <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
  33.        
  34.         <script>
  35.             var len = functions.length;
  36.            
  37.             for(var i = 0; i < len; i++) {
  38.                functions[i]();
  39.            }
  40.        </script>
  41.        
  42.     </body>
  43. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement