jQuery Address double load on init
Posted
by dazhall
on Stack Overflow
See other posts from Stack Overflow
or by dazhall
Published on 2010-06-02T11:39:36Z
Indexed on
2010/06/02
11:44 UTC
Read the original article
Hit count: 297
Hi All!
I'm using jQuery Address to load in my content, but it's doing it twice on the init. I set it up so that if you go to the main category it loads the first image, but it's doing it twice and I'm not sure how to stop it. A fresh pair of eyes would be appreciated!
$.address.init(function(event) {
$('#carousel-clip a').address();
if(!event.pathNames[0]) {
var url = $('#carousel-clip ul li:first a').attr('href').replace('#!/','');
$.address.path(url);
}
}).change(function(event) {
if(event.pathNames[0]) {
$.getJSON(location.pathname + 'image/' + event.pathNames[0] + '/', function(data, textStatus, XMLHttpRequest) { handler(data); });
}
});
You can see it working here: http://bit.ly/cKftwA
Thanks!
Darren.
© Stack Overflow or respective owner