Advertisement
lalatino

jQuery's load

Jul 1st, 2013
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.20 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  5.     <script src="test.js"></script>
  6.     <script type="text/javascript">
  7.         $(function(){
  8.             $("#loadBtn").on("click", function(event)
  9.             {
  10.         $('#container').load('test.html #container0');
  11.             });
  12.  
  13.             $("#getTest").on("click", function(event)
  14.             {
  15.                 alert(test);
  16.             });
  17.  
  18.             $("#changeTest").on("click", function(event)
  19.             {
  20.                 test="changed";
  21.             });
  22.         });
  23.         alert('cccccccc');
  24.     </script>
  25. </head>
  26. <body class="body">
  27. <div id="container0">
  28.     text1
  29.         <div id="container" style="width:200px;height:200px; padding:10px; border:1px solid black; overflow:scroll;"></div>
  30.         <input type="button" id="loadBtn" value="Load"/>
  31.         <input type="button" id="getTest" value="gettest"/>
  32.         <input type="button" id="changeTest" value="changetest"/>
  33.         <script type="text/javascript"> function aaa() { alert('aaaaaaaaaa'); } aaa(); </script>
  34.     text2
  35. </div>
  36. <!-- http://stackoverflow.com/questions/17400879/jquery-load-the-same-page-into-a-div/ -->
  37. </body>
  38. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement