1

I am using recaptcha 2nd version.After posting form date with ajax to server i am getting

"Uncaught SecurityError: Blocked a frame with origin "https://www.google.com" from accessing a frame with origin "http://localhost:14656". The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "http". Protocols must match." error.

In layout added script as src='//www.google.com/recaptcha/api.js' async defer

I am using ASP MVC 4.0 for project.

Could you help me?

Tabriz Atayi
  • 5,880
  • 7
  • 28
  • 33

2 Answers2

4

In your layout script change the src to http://www.google.com/recaptcha/api.js

The error occurs because your src is running on https and your web app on http.

Praveen Paulose
  • 5,741
  • 1
  • 15
  • 19
  • Can you paste the relevant (recaptcha) sections of your code in the question – Praveen Paulose Apr 11 '15 at 14:02
  • 1
    the link actually try to load following inside : [https:]//www.gstatic.com/recaptcha/api2/r20170104143828/recaptcha__en.js either we just have implement api.js locally, but i believe you have to do manual update incase new captcha api introduce **/api2/** – KumailR Jan 12 '17 at 06:24
-2

Try this:

<script src='https://www.google.com/recaptcha/api.js'></script>

and use:

<div class="g-recaptcha" data-sitekey="YOUR SITE KEY"></div>
  • 2
    You should try and add further explanation of what the code does and why you're doing it, this will help the questioner and increase the likelyhood of your answer being accepted. It also makes it less likely to get voted down and deleted. – Klors Nov 10 '15 at 18:59