Click here to Skip to main content
14,920,094 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am using this script but its not working. plz help me. Thank u


XML
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
   <script type="text/javascript">
     $(document).ready(function () {
       $("#SayHello").click(function (e) {
         e.preventDefault();
         $.ajax({
           type: 'GET',
           data: '{"name": "' + $("input#name").val() + '"}',
           url: 'http://localhost:2312/Webservices%20Practice/Service.asmx?op=Hello',
           contentType: 'application/json; charset=utf-8',
           dataType: 'json',
           success:
             function (data, textStatus, XMLHttpRequest) {
               alert(data.d);
             },
           error:
             function (XMLHttpRequest, textStatus, errorThrown) {
               alert(textStatus);
             }
         });
       });
     });
   </script>
Posted
Comments
Zoltán Zörgő 1-Sep-12 3:18am
   
It depends... so how the service looks like? What is the concrete issue you get? What have you tried to debug, what are your current findings?

1 solution

Hello,

Check this out Introduction to using jQuery with Web Services[^]

Thanks,
Deepak
   

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