的负载功能并不旨在收集请求响应,该功能用于负载HTML从远程文件并注入到一个DOM元素,例如:
$('a').bind('click', function(e) { var url = $(this).attr('href'); $('div#container').load(url); // load the html response into a DOM element e.preventDefault(); // stop the browser from following the link});如果处理锚元素的单击事件,则应防止浏览器跟随链接href。
还请记住,由于相同来源策略,Ajax请求只能在同一个域中完成。



