Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AurumProject/cfb5d448dec6d6af161b to your computer and use it in GitHub Desktop.
Save AurumProject/cfb5d448dec6d6af161b to your computer and use it in GitHub Desktop.
Ajax synchronous alternative - Jquery synchronous xmlhttprequest on the main thread is deprecated
/*/
Fixes bug that freeze Node JS Webkit (NWJS) with "async:false";
"Jquery synchronous xmlhttprequest on the main thread is deprecated"
It is also an alternative to execute code after the ajax response
/*/
function Server_Async(){
return $.ajax({
type: "POST",
url: "../example.php",
dataType:"json" }); //Ajax
} // ServerAsync
function After_Ajax_Response(data) {
// Do things here
var example = example.data;
}// After_Ajax_Response
Server_Async().done(After_Ajax_Response);
@prometheusaiolos
Copy link

Old is gold!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment