1

Every time I use a success function of jQuery.ajax I get the following result :

<?xml version="1.0" encoding="utf-8"?>
<int xmlns="http://tempuri.org/">-105</int>

No matter what dataType I set (json, html, xml) - that's the returned data. How can I escape the integer (-105 in this case)?

P.S. maybe I have to change somethig in my asp.net c# web method:

[WebMethod]
[ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
public int CheckRegistrationFree(string phone)
4

1 回答 1

2

这对我有用

$.ajax({
    success : function(xml){
        alert($(xml).find('int').text());
    }
})
于 2012-07-11T09:50:24.197 回答