Click here to Skip to main content
Sign Up to vote bad
good
See more: JavascriptREST
Hii
 
How can I call a REST service using Javascript? My REST response is in JSON format...]
 
Thanks,,,
Posted 27 Aug '12 - 1:35
cutie1297


1 solution

  Permalink  
Comments
Manas Bhardwaj - 27 Aug '12 - 8:36
Good +5
Prasad_Kulkarni - 28 Aug '12 - 0:04
Thank you Manas!
cutie1 - 29 Aug '12 - 12:29
I have used this code .But couldn't view any response ... <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"> function invokeService() { $(document).ready(function(){ $.ajax({ type:"GET", async:false, url:"http://localhost:8732/IServices/RoleService/json/Role/doctor", contentType:"application/json; charset=utf-8", dataType:"json", processData:true, success:function(result){ AjaxSucceeded(result); }, eror:AjaxFailed }); function AjaxSucceeded(result) { alert(result); } function AjaxFailed(result){ alert(result.status+''+result.statusText); } } </script> </head> <body> <form id="form1" runat="server"> <div> <input type="button" önclick="javascript:invokeService();" value="Call WCF Service" /> </div> </form> </body> How can I manage to get the response.Where Am I going wrong?

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 365
1 OriginalGriff 315
2 Slacker007 240
3 Dave Kreskowiak 212
4 Aarti Meswania 210
0 Sergey Alexandrovich Kryukov 8,893
1 OriginalGriff 7,134
2 CPallini 3,678
3 Rohan Leuva 3,036
4 Maciej Los 2,428


Advertise | Privacy | Mobile
Web04 | 2.6.130516.1 | Last Updated 29 Aug 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid