Hi all, I want to call remote web service using Jquery? My code is given below. <script src="js/jquery-1.3.2.min.js" type="text/javascript"></script> <script language="javascript" type="text/javascript"> $(document).ready(function() { $('#Save').click(TestingMethod); } ); function TestingMethod() { var BizName = $('#txtBizName').val(); var webMethod = "http://MyWebService/offlinecourse.asmx/TestingMethod"; var parameters = "{str:'" + BizName + "'}"; $.ajax({ url: webMethod, type: "POST", dataType: "json", data: parameters, contentType: "application/json; charset=utf-8", success: function(msg) { $('#status').html('Input is : ' + msg.d); }, error: function(e) { $('#status').html = "Unavailable"; } }); } </script> </head> <body> <form id="form1" runat="server"> <input type="text" id="txtBizName" /> <input type="button" id="Save" value="Save" /> <div id="status"> </div> </form> </body> </html>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)