Guest User

Website loading using an iframe and AJAX

a guest
Feb 26th, 2013
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.36 KB | None | 0 0
  1. <html>
  2.     <head>
  3.         <title>Using both</title>
  4.         <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
  5.         <script type="text/javascript" src="https://ceti-redesign.googlecode.com/files/jquery.xdomainajax.js"></script>
  6.         <script type="text/javascript">
  7.             $(function() {
  8.                 $.ajax({
  9.                     url: 'http://www.stackoverflow.com/',
  10.                     type: 'GET',
  11.                     success: function(data) {
  12.                         $("#content").contents().find('body').append(data.responseText);
  13.                     }
  14.                 });
  15.             });
  16.         </script>
  17.         <style type="text/css">
  18.             body {
  19.                 margin: 0;
  20.             }
  21.             #ontop {
  22.                 position: absolute;
  23.                 width: 100%;
  24.                 height: 10%;
  25.                 top: 0;
  26.                 bottom: 90%;
  27.                 background-color: yellow;
  28.             }
  29.             #content {
  30.                 position: absolute;
  31.                 width: 100%;
  32.                 height: 90%;
  33.                 top: 10%;
  34.                 bottom: 0;
  35.                 border: 0;
  36.             }
  37.         </style>
  38.     </head>
  39.     <body>
  40.         <div id="ontop">Always on top</div>
  41.         <iframe id="content"></iframe>
  42.     </body>
  43. </html>
Advertisement
Add Comment
Please, Sign In to add comment