Solution 1:
In global settings:
##JsCode
- $.ajax
Setup({
- async :
false
- });
$.ajaxSetup({
async : false
});
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");
}
});
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!
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn