jQuery AJAX & an ASP.NET web service works locally but not remotely

Posted by Alex on Stack Overflow See other posts from Stack Overflow or by Alex
Published on 2010-04-06T15:17:49Z Indexed on 2010/04/06 15:23 UTC
Read the original article Hit count: 149

Filed under:
|

Interesting one here. I have an ASP.NET 1.1 project that contains a web service in it. I'm using jQuery's AJAX functionality to call some services from the client. This is what my code looks like:

$.ajax({
    type: "POST",
    url: 'foo.asmx/functionName',
    data: 'foo1=' + foo1 + '&foo2=' + foo2,
    dataType: "xml",
    success: function(xml) {
        //do something with my xml data
    },
    error: function(request, error){
        //handle my error

    }       

});

This works great when I run the site from my IDE on localhost. However, when I deploy this site to any other server I get a parsererror error from jQuery. It does not appear to even call my service as I dropped in some code to write a log file to disk and it's not making it there.

The same exact XML should be returned from both my localhost and the server I deployed to.

Any ideas?

© Stack Overflow or respective owner

Related posts about jquery-ajax

Related posts about ASP.NET