jquery - How to loop through WCF using Ajax -
this bit black magic me i've created wcf service online tutorial display sql data (running asp.net solution locally produces results service presume it's running correctly).
what i'm trying connect service html page, script i've created.
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"> </script> <script type="text/javascript"> $(function () { // send ajax request alert("running"); $.ajax({ type: "get", url: "http://localhost:15021/service1.svc/getallcustomers", datatype: "json", success: alert("success"), error: alert("failure") }); }); </script>
i no errors 2 alerts (the success , failure), question how start work data wcf returning?
any advice great.
thanks, craig
success: function(response){ //do things want response data getting. //and yes getting json response, if not there errors } failure: function(x,e){ //do things want in case of failure. }
Comments
Post a Comment