Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
- <script src="test.js"></script>
- <script type="text/javascript">
- $(function(){
- $("#loadBtn").on("click", function(event)
- {
- $('#container').load('test.html #container0');
- });
- $("#getTest").on("click", function(event)
- {
- alert(test);
- });
- $("#changeTest").on("click", function(event)
- {
- test="changed";
- });
- });
- alert('cccccccc');
- </script>
- </head>
- <body class="body">
- <div id="container0">
- text1
- <div id="container" style="width:200px;height:200px; padding:10px; border:1px solid black; overflow:scroll;"></div>
- <input type="button" id="loadBtn" value="Load"/>
- <input type="button" id="getTest" value="gettest"/>
- <input type="button" id="changeTest" value="changetest"/>
- <script type="text/javascript"> function aaa() { alert('aaaaaaaaaa'); } aaa(); </script>
- text2
- </div>
- <!-- http://stackoverflow.com/questions/17400879/jquery-load-the-same-page-into-a-div/ -->
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement