Solution 1:
In global settings:
##JsCode
- $.ajax
Setup({
- async :
false
- });
$.ajaxSetup({
async : false
});
Copy after login
Then use the post or get method
##Js code
$.get(- "register/RegisterState"
, {test : 12},function(data, status) {
-
if (status == "success") {
## data = eval( "(" - + data +
")");
aDataSet = data;
-
alert(
"data is "- + aDataSet);
}
- else
{
alert( "wrong"- );
}
-
});
-
$.get("register/RegisterState", {test : 12}, function(data, status) {
if (status == "success") {
data = eval("(" + data + ")");
aDataSet = data;
alert("data is " + aDataSet);
} else {
alert("wrong");
}
});
Copy after login
Solution 2:
Use $.ajax directly, such as
Js code
$.ajax({
-
type:
"post"- ,
: "Register/RegisterState" - ,
Data: "Test =" - + TES
async :
false , -
## success : function
(data){
-
data = eval("("
+ data + ")" - );
##
The above is the detailed content of Synchronization issues of post and get in jquery. For more information, please follow other related articles on the PHP Chinese website!