I found more thing,
when i change this
error: function(xhr) {
alert(xhr.status);
}
to
error: function(xhr,error) {
alert(xhr.status);
alert(error);
},
the second alert gives me a parseerror
so i assume it should be something wrong with my json string,
but how come it works in my local but no on the server......
On 8月31日, 下午8時13分, dasatan <[email protected]> wrote:
> hi all,
> I got an ajax code, when i run it in local it goes fine, but when i
> upload to server it always gets to error status
> i checked the status it does show 200,
> can anyone help me to fix this problem
>
> $.ajax({
> url: 'game_func.php?act=ioratio',
> dataType: "json",
> success: function(json) {
> if(json.callback == "done")
> {
> teamcon.value = json.newcon;
> document.getElementById("team1_io").value =
> json.newio1;
> document.getElementById("team2_io").value =
> json.newio2;
> }else{
> if(json.value == "concede")
> {
> alert('球投輸入錯誤!!');
> }
> }
> },
> error: function(xhr) {
> alert(xhr.status);
> }
> });
>
> and this is the json string return
>
> {"callback":"done","newcon":"2.5","newio1":"0.850","newio2":"0.850"}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---