title: Getting content from another page with javascript not working
body: <p>I was trying to perform client side validation for <code>captcha</code>. For that I need to get the response from an external <code>url</code>. I used the below <code>javascript</code> code for that.</p>
  
  <pre><code>&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
    function captcha_check()
    {
      var code = document.getElementById("captcha").value;
      alert(code);
      var url = "http://www.opencaptcha.com/validate.php?img='.$captcha_name.'.jpgx&amp;ans="+code;
      alert(url);
      $.get(url,function(data,status){
        alert(data);
        if(data == "fail")
        {
          document.getElementById("captcha_error").style.display = "block";
          return false;
        }
        else
        {
          return true;
        }
      });
    }
  &lt;/script&gt;
  </code></pre>
  
  <p>But the code is not working. The <code>url</code> and <code>code</code> are alerting correctly. But the <code>javascript</code> stops executing the jquery function to get content from the <code>url</code> and skipping the remaining steps in the function.</p>
  
  <p>Please help me find out what's wrong with my code.</p>
  
  <p>Thank you all in advance.</p>