Created
April 15, 2015 23:26
-
-
Save AurumProject/cfb5d448dec6d6af161b to your computer and use it in GitHub Desktop.
Ajax synchronous alternative - Jquery synchronous xmlhttprequest on the main thread is deprecated
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*/ | |
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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Old is gold!