2

I have a JSON response coming from REST web service and want to bind that data to html using jQuery. Looks like its not even hitting web service url which I have provided in my jquery. Url is working fine which gives me JSON data in browser but jQuery I am using unable to get any content from this. I am pasting my code here, plz let me know if some one can help. While debugging script its directly going on error section in ajax call.

<script type="text/javascript">

 $(document).ready(function () {
        GetData();

    });

    function GetData() {

        //  alert(textblock.value);
        $.ajax({
            type: "GET",
            url: "http://localhost:8092/api/Employees",
            data: "{'employeeId'= '" + 1234 + "'}",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                var results = $.parseJSON(msg.d);
                alert(msg);
                alert(results);
            },
            error: function (result) {
                alert('here');
                var tt = result.text;
                alert(tt);
            }
        });
    }



</script>
rajcool111
  • 657
  • 4
  • 14
  • 36

1 Answers1

0

finally i am able to get data now. I added below properties in $.ajax:

processData: false, async: false,

rajcool111
  • 657
  • 4
  • 14
  • 36