is it possible to disable jQuery ajax() calls? As a developer, I ofttimes need to test site without ajax (without actually turning js off).
I would create a script that utilizes local database: when certain link is clicked, it would toggle a property. Ie. how can I effect global bindings such as
$("a.ajax").live("click", function (event) {
event.preventDefault();
$.get(this.href);
});
without actually changing the code itself? Could I replace the ajax() function? How would you deal with this?
You can override jQuery’s
getmethod with an empty annonymous function of your own, before any of your code is run:Or you could use jQuery’s
$.noop, which is basically the same thing: