简体   繁体   English

谷歌浏览器和Android浏览器中的console.log本机代码错误

[英]console.log native code error in google chrome and android browsers

Im using following function to display data after user click on sign up button.This works perfectly fine on Mozilla firefox but gives native code error on Google chrome and Android browser where im wrong ? 我在用户单击注册按钮后使用以下功能来显示数据。这在Mozilla firefox上工作得很好,但在Google chrome和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 is a function, you should either use alert(something) or console.log(something) console.log是一个函数,您应该使用alert(something)console.log(something)

error:function (data) {
    alert(data); // or console.log(data)      
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM