how to consume wcf service hosted by windows service using java script

旧城冷巷雨未停 提交于 2019-12-01 14:38:43

I had got the answer Here is the code written in javascript

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    <script type="text/javascript">
        window.onload = invokeService();
        function invokeService() {
            $(document).ready(function () {


                //   Additional way of calling WCF service using getJSON() JQuery method
                $.getJSON("http://localhost/WcfJsonRestService/Albums/rjinfo", {},
                    function (data) {
                         alert("hello " + data);

                    });
            });
            }


    </script>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!