Click here to Skip to main content
15,895,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
function testJson() {
alert("enter");
$.ajax({
type: "POST",
url: "http://xyz.com",
data: {username:'abc',Password:'abcd'},

contentType: "application/json; charset=utf-8",
dataType: "json",
success: function() {
alert("select");
},
error: function() {
alert("wrong");
}
});
};
My problem is that when i m running this code its not working as, its going into error part and what i think there is a problem in passing parameters to webservice through this code.Plz help
Posted
Updated 29-Dec-13 19:11pm
v2

Please put the complete url of your Webservice into the url type, bcoz u have put only http here...that's the error...

If there is any problem in getting the response from WebMethod then only it will goes into the error part...

Try this, hope this will helps you..
 
Share this answer
 
Hi Nishant ,
I have did as you told me but still i am into error part, May you check my jquery code again?
 
Share this answer
 
Comments
Karthik_Mahalingam 30-Dec-13 1:24am    
please use "have a question or comment ?" button to post query or comments..
thanks.
Jain Nishant 30-Dec-13 5:31am    
Please let me know... what's the error msg it is showing... if u'r using Firefox then plz swithch on the firebug by pressing F-12 and see what's the msg it is showing...
PHP
var urls = "~/home/test"

$.ajaxSetup
           (
               {
                   cache: false
               }
           );
           $.getJSON(urls,
               {
                   a: a,
                   b:b,
                   

               },
               function (data) {


});
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900