我正在使用 Ajax 提交 hybridauth,但提交直接失败,有没有人尝试过这样的事情?请参阅下面的代码示例。
(login.php 未更改,但将结果发送到处理程序文件,该处理程序文件将结果发送回成功)
$(".socialClient").click(function(){
var socID = $(this).attr("id"); //the ID for the social media provider image is the name of the provider
$.ajax({
type: "GET",
url: "hybridauth/login.php",
cache: false,
data: {provider:socID},
//enctype: "multipart/form-data",
dataType: "text",
success: function(data){
//handle response, user info and such
},
error:function (xhr, ajaxOptions, thrownError){
alert("Social media logon failed. Error code:" +thrownError);
}
});
});