2014年4月10日 星期四

JQurey

src:

http://stackoverflow.com/questions/10371801/how-can-i-use-ajax-as-an-alternative-to-an-iframe

notes:


--------------
Since you won't be using iFrames you will need a container to put your page into. With AJAX, it is common practice to use a <div> element to hold that data. Also, jQuery or another Javascript library supporting AJAX will make your life easier with working tested code so you can focus on your business logic rather than the nitty gritty. So, in your HTML, you will need a container element:
<div id="otherpage"></div>
Then in an included javascript file, you can use this jQuery:
$(document).ready(function() {
   $('#otherpage').load('otherpage.html', function() {
      alert('Load was performed.');
   });
});
Of course, before using that, make sure you include jQuery as well. This tutorial should help you get started with jQuery.
share|improve this answer

沒有留言:

張貼留言