我正在尝试使用 jQuery 验证 Recaptcha,但我不断收到错误消息告诉我:访问受限 URI 被拒绝”代码:“1012
这是我迄今为止尝试过的:
var challengeVal = $("#recaptcha_challenge_field").attr("value");
var reponseVal = $("#recaptcha_response_field").attr("value");
var remoteIp = <%= "'" + Request.ServerVariables["REMOTE_HOST"] + "'" %>
var privateKey = 'MY_PRIVATE_KEY';
var requestUrl = "http://api-verify.recaptcha.net/verify?privatekey=" + privateKey + "&remoteip=" + remoteIp + "&challenge=" + challengeVal + "&response=" + reponseVal;
$.ajax({
type: "POST",
url: requestUrl,
dataType: "json",
success: function(data) {
alert('response from recaptcha');
},
error: function() {
alert("An error occured.");
}
});
有人试过这个,谁能指出我正确的方向?
谢谢。