Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  1] [ 1]  / answers: 1 / hits: 28928  / 14 Years ago, mon, july 26, 2010, 12:00:00

I am getting a javascript error on firefox 3.5, when trying to call an ajax method.



Please find the error below:



XML Parsing Error: no element found Location: moz-nullprincipal:{1a2c8133-f48f-4707-90f3-1a2b2f2d62e2} Line Number 1, Column 1:

^


this is my javascript function:



function Update(Id) {
$.ajax({
type: GET,
url: ROOT_URL + /sevice/udates.svc/Update?Id= + Id,
success: function(response) {

},
async: false
});
}

More From » jquery

 Answers
13

The ajax call expects XML back (perhaps due to bad guessing) and tries to parse it and fails if nothing is returned or it is not valid XML..



Use the dataType option to specify the format of the response.






From the comments it looks like some browsers cannot handle an no-content response. So, a workaround for such cases might be to return something from your service (even a single space).


[#96106] Friday, July 23, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
wilson

Total Points: 27
Total Questions: 93
Total Answers: 93

Location: Tajikistan
Member since Sun, Aug 29, 2021
3 Years ago
wilson questions
Tue, Aug 9, 22, 00:00, 2 Years ago
Wed, May 11, 22, 00:00, 2 Years ago
Wed, May 20, 20, 00:00, 4 Years ago
Wed, May 13, 20, 00:00, 4 Years ago
;