0

index.html中,我使用代码导入了ajax.js

$(function() {
    $('a[name!=modal][name!=skipJQuery]').click(function(){
        $('#content').load($(this).attr('href'));
        $('#content').scrollTop();

            return false;
}); });

#content是一个加载页面的div 。#content中的页面无法识别在index.html之上导入的ajax.js。我怎样才能解决这个问题?..让#content中加载的页面识别ajax.js

4

1 回答 1

0

Is it the click event not firing on links in the imported content? If so, maybe try using the 'on' event binder.

$("body").on("click", "a[name!=modal][name!=skipJQuery]", function(){
    $('#content').load($(this).attr('href'));
    $('#content').scrollTop();
    return false;
});
于 2013-04-17T19:29:22.637 回答