I have the following jQuery calling a method in a coldfusion component
$.getJSON("/blah/listing.cfc?method=bleep&returnformat=json",{"status":status},function(res,code)
alert(res);
if(res == 1){
top.location.reload(true);
}
$('#chase-form .btnChase').removeAttr("disabled");
});
return true;
The call runs successfully and does what's it's supposed to. However, because of the way the component is written, it blocks the callback and the alert() does not fire. Until I sort out the reasons for the blocked callback, I need to get this page refreshing.
Is there some temporary bodge/hack I can use to just get the page to reload. I've tried a setTimeout function, but that doesn't work, e.g.
setTimeout(function(){
$.getJSON("/blah/listing.cfc?method=bleep&returnformat=json",{"status":status},function(res,code){
alert('here');
$('#chase-form .btnChase').removeAttr("disabled");
if(res == 1){
top.location.reload(true);
}
}, 5000);
});
I have the following jQuery calling a method in a coldfusion component
$.getJSON("/blah/listing.cfc?method=bleep&returnformat=json",{"status":status},function(res,code)
alert(res);
if(res == 1){
top.location.reload(true);
}
$('#chase-form .btnChase').removeAttr("disabled");
});
return true;
The call runs successfully and does what's it's supposed to. However, because of the way the component is written, it blocks the callback and the alert() does not fire. Until I sort out the reasons for the blocked callback, I need to get this page refreshing.
Is there some temporary bodge/hack I can use to just get the page to reload. I've tried a setTimeout function, but that doesn't work, e.g.
setTimeout(function(){
$.getJSON("/blah/listing.cfc?method=bleep&returnformat=json",{"status":status},function(res,code){
alert('here');
$('#chase-form .btnChase').removeAttr("disabled");
if(res == 1){
top.location.reload(true);
}
}, 5000);
});
Share
Improve this question
edited Mar 12 at 16:08
Barmar
784k57 gold badges548 silver badges659 bronze badges
asked Mar 12 at 8:39
user460114user460114
1,8954 gold badges31 silver badges56 bronze badges
7
|
Show 2 more comments
1 Answer
Reset to default 0I found the problem. I started changing things around according to mykaf's suggestion and realized that I had a <cfajaximport>
tag at the top of the included file. I don't know why but this caused the problem. I remove it and the original code worked fine.
#viewFile#
in your included template? It doesn't seem to be defined anywhere in the included code. – mykaf Commented Mar 13 at 19:23