Im使用以下函数在用户单击注册按钮后显示数据。这在Mozilla Firefox上工作得很好,但在谷歌浏览器和Android浏览器上给出本机代码错误,我错了?
function postdata(){
var chkfrm = checkdata();
if(chkfrm == 0){
var url = 'http://domain.com/index.php/Signup/signin';
$.ajax({
type: "POST",
url: url,
data: $("#formI").serialize(), // serializes the form's elements.
beforeSend:function(){
$("#signupdiv").html('<img src="http://domain.com/images/signuploading.gif" />');
},
success:function(data)
{
$("#signupdiv").html(data);
},
error:function () {
alert(console.log);
}
});
}
else {
$("#msgjava").html('<p>We need a little bit information from you.Please fill it.</p>');
return false;
}}
console.log
是一个函数,你应该使用alert(something)
或console.log(something)
error:function (data) {
alert(data); // or console.log(data)
}