Browser compatibility problems in IE compatibility mode SCRIPT1028: The identifier, string, or number is missing, and the script1028 identifier
Directly run the Code:
No previous Code modified
Var ajaxPost = function (url, data, callback ){
$. Ajax ({
Type: 'post ',
Url: url,
Data: {"data": data },
DataType: 'json ',
Success: function (data ){
If (data. success = true ){
If (callback! = Undefined ){
Callback (data. data );
}
} Else {
Alert ("failed to execute ");
}
},
});
};
I marked the cause of this error in red. Firefox and Google browsers can all pass by default, but IE won't work.
Var ajaxPost = function (url, data, callback ){
$. Ajax ({
Type: 'post ',
Url: url,
Data: {"data": data },
DataType: 'json ',
Success: function (data ){
If (data. success = true ){
If (callback! = Undefined ){
Callback (data. data );
}
} Else {
Alert ("failed to execute ");
}
}
});
};
Remove the comma.