开发者

Cannot get jQuery click handler to fire on ajax loaded element

开发者 https://www.devze.com 2022-12-18 01:36 出处:网络
\"MyParentPage.htm\" uses the load function of jquery to load(\'myDiv.htm\') // myDiv.htm only contains:

"MyParentPage.htm" uses the load function of jquery to load('myDiv.htm') //

myDiv.htm only contains:

<a href="#" class="bt-cbox">Click me</a>

I have th开发者_如何学JAVAe following in "MyParentPage.htm"

$(document).ready(function() {    
    $(".bt-cbox").click(function() {    
        alert("handler hit");
    });
});

Why is the my alert not being hit


$(document).ready(function() {
    $(".bt-cbox").live("click",function() {
        alert("handler hit");
    });
});

See live

0

精彩评论

暂无评论...
验证码 换一张
取 消