意外的标记>

Unexpected token >

本文关键字:gt 意外      更新时间:2023-09-26

脚本以前可以工作,现在突然不工作了。它返回了一个意外的token>错误,这毫无意义,因为我在这里没有编辑任何内容,但在删除我添加的其他代码时,它仍然不起作用。在我尝试修复后,按钮现在不会触发代码,但这是另一个问题。你们明白为什么吗?

function dologin() {
    var senddata = $('#form').serialize();
    $.ajax({
        type: 'post',
        url: 'herpaderp',
        data: senddata,
        crossDomain: true,
        dataType: 'json',
        success: function (response) {
            if (response.success == true)
                window.location.href = "herpderp";
            else if (response.success == false)
                navigator.notification.alert("Feil brukernavn eller passord", null, "Mislykket innlogging", "OK");
            else
                alert("Noe gikk galt, kontakt administrator");
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            console.log("Status: " + textStatus);
            console.log("Error: " + errorThrown);
        }
    });
    return false;
};

现在似乎可以工作了,不知怎么的,是我的HTML代码坏了。谢谢你们的帮助!