Let me explain. I'm writing code and added breakpoint before some ajax query. I've analysed data from variables and now want to prevent ajax query execution, but if I resume code, it will be executed. I can refresh page and ajax query will not be send, but how to do this without loosing page changes on the fly?
1 Answer
How did you call your AJAX function?
If you call it like this
function AJAXCaller() {
... // CODE THAT ANALYZE THE DATA
$.ajax({ ... });
... // CODE CONTINUATION
}
then you could probably add some variable as a flag to decide whether to run the AJAX or not like this
var runAJAX = true;
function AJAXCaller() {
... // CODE THAT ANALYZE THE DATA
if(runAJAX) {
$.ajax({ ... });
}
... // CODE CONTINUATION
}
then you could add the breakpoint at the if(runAJAX) {, then if you decide not to run the AJAX call, change the runAJAX value using the console