Skip to content

Instantly share code, notes, and snippets.

@3emad
Created April 2, 2012 18:29
Show Gist options
  • Save 3emad/2286103 to your computer and use it in GitHub Desktop.
Save 3emad/2286103 to your computer and use it in GitHub Desktop.
Chrome developer tool bug[network tab]: Double ajax post previewed is repeated
/*
* showed in chrome network posted the same value and returned the same response
* the following code will call action "getBar" twice
* $.post("example.com",{action:'getFoo'},function(data){},"json");
* $.post("example.com",{action:'getBar'},function(data){},"json");
*
* in google chrome network tab, it will show that getFoo is ignored and getBar was called twice, though
* the object response are correct on the javascript end.
*
* work around to this bug:
*/
$.post("example.com?foo",{action:'getFoo'},function(data){},"json");
$.post("example.com?bar",{action:'getBar'},function(data){},"json");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment