我创建了一个网页并使用 load() 函数将页面加载到固定 div 上。但是在连续点击不同的链接时……整个网页停止响应。
这是我加载页面的代码:
$( document ).ready( function() {
$('a').bind('click' , function( e ) {
e.preventDefault(); // prevent the browser from following the link
e.stopPropagation(); // prevent the browser from following the link
$( '#part1' ).load( $( this ).attr( 'href' ) );
});
});
当我单击上述 load() 函数的链接时,我还想更改 url。