Today I explored something weird: jQuery Address do not work in jQuery callbacks: http://jsfiddle.net/Wh7uS/19/ Any suggestions?

有帮助吗?

解决方案

Your binding to the init event of the address, which is triggered before the callback. You can see that if you change the fadein timer to 0:

$("#second").fadeIn(0, function() {

jQuery.address.init(function(event) {
    alert("jQuery Address - inside");
});
alert("Sorry for the many alerts");
});

It's callback will run immediately, binding the init event handler which will be invoked and shoot of the alert (all from in the callback). Timing is everything :)

其他提示

Are you looking for something like that? http://jsfiddle.net/Wh7uS/18/

change jquery to jquery <1.6 and things work fine.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top