开发者

Using jQuery Templates and wiring up events after render

I am using jQuery Templa开发者_如何学编程tes successfully but I have a blur function that is not getting called on the new elements being added to the page. I assume its because they are not wired up to it for some reason.

Do I need to do something to fix it or should Ichange the blur function to use jQuery live?

$('.serial').blur(function () {
//Do stuff
});


you need to use live() on elements that are added after the DOM has finished loading.

bind() or aliases such as blur() only affect elements in the DOM at the time of calling.

eg: $('.serial').live('blur', function(){ /* do stuff */ });

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜