gpt4 book ai didi

javascript - JQuery 仅在 ie7 中破坏页面上的所有脚本

转载 作者:行者123 更新时间:2023-11-30 06:58:22 25 4
gpt4 key购买 nike

将此包含在脚本中后,页面上使用的所有 jquery 都停止工作,但仅在 ie7 中,一旦我将其删除,它们就会重新开始工作。

  function go_standards()
{
var audit_id = $('#auditID').val();
$.ajax({
type: "POST",
url: "../ajax/create_audit_ajax.php",
data: $('#audit_form').serialize(),
success:function(response){
window.location = "../standards.php?page=create_audit&auditID="+audit_id;
},
});
}

绑定(bind)的按钮

    <input type="button" name="standard" id="standard"
class="control_submit standard_btn" value="" onClick="go_standards()" >

我试过从最后一个参数中删除多余的逗号,在原来的外部脚本上使用它,然后将其放入页面的标题中。没有任何错误消息,什么都没有。

我在虚拟机上的 ie7 上运行它,没有 f12 开发人员工具来查看是否有任何错误等

最佳答案

IE8 及以下版本在尾随额外逗号时出错。

末尾的额外逗号可能会导致问题:

  $.ajax({
type: "POST",
url: "../ajax/create_audit_ajax.php",
data: $('#audit_form').serialize(),
success:function(response){
window.location = "../standards.php?page=create_audit&auditID="+audit_id;

},//here, remove it

});

关于javascript - JQuery 仅在 ie7 中破坏页面上的所有脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22405665/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com