0

I am having a webmethod that returns some data.I'm using jquery to call that function with its Content type specified as XML.The problem is that it is working on local machine but not on server.The code i'm using is:

var arrInputs = pnl.getElementsByTagName("input"); str = arrInputs[0].value; $.ajax({ type: "POST", url: "../curriculum.asmx/EditListBox", dataType: "xml", data: "setcur_id=" + str + "", processData: false, success: function(xml) { ajaxFinish(xml); }, error: function() }); 

Ajaxfinish is defined afterwards and it works fine on local Is there some more settings i need to do to make it executable

4
  • 1
    Have you tried an absolute URL? Commented Jan 4, 2010 at 14:14
  • 1
    Observe the "Net" tab in your console and check the server response. You might want to revise the error handler in the ajax post as well. Commented Jan 4, 2010 at 14:17
  • Yes i have tried the absolute url its still not working Commented Jan 5, 2010 at 4:10
  • undefined error is given Commented Jan 5, 2010 at 4:38

1 Answer 1

1

If you have moved changed the host then the issue is most likely with the page you are requested, not your javascript code.

Check that what is being returned when you request "../curriculum.asmx/EditListBox" is the same in the local and remote environments.

You can do this either by submitting the request manually in your browser (you'll need to use an FF extension to set the post data) or using the Net tab in firebug.

Alternatively I also use an excellent little tool called Charles (http://www.charlesproxy.com/) which monitors all your http requests and allows you to go in and tinker with them.

Either way you will probably find a discrepancy between what is returned on the local and remote versions that is causing the problem.

As mentioned, you might also want to add in a more descriptive error handler that could get you some more details about why it is failing

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.