I am having trouble passing the url of $.PhotoUpdater.doUpdate(url)
to do the doUpdate
function.
Firefox returns this error :
useless setTimeout call (missing quotes around argument?)
[Break on this error] timer = setTimeout($.PhotoUpdater.doUpdate(url), 5000)
my code:
$.extend({
PhotoUpdater: {
startUpdate: function(organization, gallery){
url = "/organizations/" + organization + "/media/galleries/" + gallery + "/edit_photo_captions"
timer = setTimeout($.PhotoUpdater.doUpdate(url), 5000)
},
stopUpdate: function(){
clearTimeout(timer);
timer = 0;
},
doUpdate: function(url){
$.ajax({type: "GET", url: url, dataType: "script"});
}
}
});
How I call it:
$.PhotoUpdater.startUpdate("#{@organization.id}", "#{@gallery.id}");