homebizseohomebizseocom
New Member
I am using javascript to access the below WCF Ajax Web Service.\[code\][OperationContract] public string Test() { return "test"; }\[/code\]I am using the below javascript to execute the method and have a button hooked up to the function.\[code\]<asp:ScriptManager ID="ScriptManager1" runat="server"><Services> <asp:ServiceReference Path="~/AjaxService.svc" /></Services></asp:ScriptManager><script type="text/javascript">function TestFunction() { alert(JSON.stringify(AjaxService.Test()));}</script>\[/code\]Now when I run the code the alert says undefined. However when I check in firebug I can see that the Webmethod has actually worked correctly. I get an http response of {"d":"test"}.How can I access the string that I have returned from the Ajax Web Method in javascript?