Calling a REST API through JS and html
<p>I have written the below code to get the status of the REST service. But when I am clicking on the button, it is not doing any action. Please suggest what I am missing to get this code working.</p>

<pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;

&lt;head runat="server"&gt;
  &lt;title&gt;&lt;/title&gt;
  &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;
  function invokeService() {
    $(document).ready(function() {
          $.ajax({
            type: "GET",
            async: false,
            url: "https://inf:7871/smcfs/heartbeat",
            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);
          }
        }
  &lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
  &lt;form id="form1" runat="server"&gt;
    &lt;div&gt;
      &lt;input type="button" önclick="javascript:invokeService();" value="Call WCF Service" /&gt;
    &lt;/div&gt;
  &lt;/form&gt;
&lt;/body&gt;

&lt;/html&gt;
</code></pre>