Я применяю Google + логин на своем веб-сайте. но когда я отправить данные на мою службу, чтобы сохранить его на базе данных он дает мне следующую ошибку:google + ошибка входа. Заблокирован кадр с источником «http: // localhost»
Uncaught SecurityError: Blocked a frame with origin
"http://localhost"
from accessing a frame with origin " https://apis.google.com ". The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "https". Protocols must match.
моему код: эта функция заполняет значения в текстовых полях. и значения заполняются правильно.
function signinCallback(authResult) {
if (authResult['status']['signed_in']) {
gapi.client.load('plus', 'v1', function() {
var request = gapi.client.plus.people.get({
'userId': 'me'
});
request.execute(function(resp) {
var googleId = resp.id;
var name=resp.displayName
isGoogleSignUp(googleId, function(res) {
if (res) {
window.location = "profile.php";
} else {
$("#loginPopup").css("dispaly", "none");
$("#signupPopup").css("display", "block");
$("#socialName").val(name);
//$("#socialMail").val();
$("#socialId").val(googleId);
$("#socialType").val("google");
}
});
console.log(resp);
});
});
} else {
console.log('Sign-in state: ' + authResult['error']);
}
}
Эта функция дает ошибку при вызове кнопки отправки
Нажать наfunction socialSignUp1() {
var urlString = "Service/socialSignup.php";
var form = new Object();
form.socialId = $("#socialId").val;
console.log(form.socialId);
form.type = $("#type").val();
form.name = $("#socialName").val();
form.mail = $("#socialMail").val();
form.phone = $("#socialPhone").val();
form.address = $("#socialAddress").val();
$.ajax({
type: 'POST',
data: form,
url: urlString,
success: function(resultData) {
if (resultData == 1) {
window.location("profile.php");
}
},
error: function(resultData) {
alert(resultData);
},
failed: function() {
alert("hello");
}
});
}
Вау, действительно люди по-прежнему используют 'alert' для отладки Javascript? –
Вы, кажется, не задали вопрос. Вы указали сообщение об ошибке, но эта ошибка сообщает вам, что именно вам нужно делать. – Quentin
@ AntonioRagagnin - Это очевидно и блокирует, поэтому часто полезно. – Quentin