title: No 'Access-Control-Allow-Origin' header is present on the requested resource. The response had HTTP status code 405
body: <p>im using <a href="https://www.google.com/recaptcha/intro/index.html" rel="nofollow">google recaptcha</a> to the default built in login of laravel 5 and im in the process of catching the captcha's validation response from the API (e.g. success: true|false). Below is the script i used to communicate with the googles recaptcha API.</p>
  
  <pre><code>//trigger the login button
  $("#loginbutton").click(function (e) {
                      /* Check if the captcha is complete */
                      var captchaResponse = $("#g-recaptcha-response").val();
                      if ($("#g-recaptcha-response").val()) {
                          $.post("https://www.google.com/recaptcha/api/siteverify?secret=MySecretKeyHere&amp;response=" + captchaResponse, {/* no data */}, function(response){
                              if(response.success)
                              {
                                  alert("asdasd");
                              }
                          }, 'json');
  
                      } else {
                          alert("Please fill the captcha!");
                      }
  
  
                      e.preventDefault();
                  });
  </code></pre>
  
  <p>but sadly not working, instead I got this error (refer below)</p>
  
  <blockquote>
    <p>recaptcha__fil.js:163 XHR finished loading: POST "<a href="https://www.google.com/recaptcha/api2/reload?k=mySiteKey" rel="nofollow">https://www.google.com/recaptcha/api2/reload?k=mySiteKey</a>".xj.send @ recaptcha__fil.js:163Uk @ recaptcha__fil.js:211f.wj @ recaptcha__fil.js:209f.ye @ recaptcha__fil.js:207f.kb @ recaptcha__fil.js:207f.send @ recaptcha__fil.js:208Wk.send @ recaptcha__fil.js:212L @ recaptcha__fil.js:33Wk.send @ recaptcha__fil.js:212(anonymous function) @ recaptcha__fil.js:284(anonymous function) @ recaptcha__fil.js:193z.la @ VM12395:1(anonymous function) @ recaptcha__fil.js:193e.Ob.e.wd @ recaptcha__fil.js:36fd @ recaptcha__fil.js:40bd @ recaptcha__fil.js:40L.kj @ recaptcha__fil.js:39Ic @ recaptcha__fil.js:33
    recaptcha__fil.js:163 XHR finished loading: POST "<a href="https://www.google.com/recaptcha/api2/userverify?k=mySiteKey" rel="nofollow">https://www.google.com/recaptcha/api2/userverify?k=mySiteKey</a>".xj.send @ recaptcha__fil.js:163Uk @ recaptcha__fil.js:211f.wj @ recaptcha__fil.js:209f.ye @ recaptcha__fil.js:207f.kb @ recaptcha__fil.js:207f.send @ recaptcha__fil.js:208Wk.send @ recaptcha__fil.js:212L @ recaptcha__fil.js:33Wk.send @ recaptcha__fil.js:212(anonymous function) @ recaptcha__fil.js:286(anonymous function) @ recaptcha__fil.js:193z.la @ VM12474:1(anonymous function) @ recaptcha__fil.js:193e.Ob.e.wd @ recaptcha__fil.js:36fd @ recaptcha__fil.js:40bd @ recaptcha__fil.js:40L.kj @ recaptcha__fil.js:39Ic @ recaptcha__fil.js:33
    jQuery-2.1.3.min.js:4 OPTIONS <a href="https://www.google.com/recaptcha/api/siteverify?secret=MySecretKey" rel="nofollow">https://www.google.com/recaptcha/api/siteverify?secret=MySecretKey</a> n.ajaxTransport.k.cors.a.crossDomain.send @ jQuery-2.1.3.min.js:4n.extend.ajax @ jQuery-2.1.3.min.js:4n.each.n.(anonymous function) @ jQuery-2.1.3.min.js:4(anonymous function) @ login:53n.event.dispatch @ jQuery-2.1.3.min.js:3n.event.add.r.handle @ jQuery-2.1.3.min.js:3
    login:1 XMLHttpRequest cannot load <a href="https://www.google.com/recaptcha/api/siteverify?secret=MySecretKey" rel="nofollow">https://www.google.com/recaptcha/api/siteverify?secret=MySecretKey</a>. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<a href="http://juliver.motgh.com" rel="nofollow">http://juliver.motgh.com</a>' is therefore not allowed access. The response had HTTP status code 405.</p>
  </blockquote>
  
  <p>Any ideas? clues? help? suggestions? recommendations?</p>