使用两个jQuery函数获取"ReferenceError: document is not defined&

Using two jQuery functions, getting "ReferenceError: document is not defined" on the second one

本文关键字:ReferenceError quot document defined not is 获取 函数 jQuery 两个      更新时间:2023-09-26

我正在编写一个MVC应用程序,在一个页面上,我需要动态地给所有元素一个ID,因为表的呈现方式和数据是如何传递给它的。第一个jQuery函数工作得很好,但第二个就不行了。当我在firebug中检查控制台时,我得到错误

"ReferenceError: document is not defined"

关于那个函数/我确信我只是没有得到语法正确的东西,但我不能找出什么可能是错误的。我的代码如下:

<script type="text/javascript" charset="utf-8">
$(document).ready(function () {
    var oTable1 = $('#example1').dataTable({
        sScrollX: "100%",
        sScrollY: "200px",
        bFilter: false,
        bScrollCollapse: true,
        bPaginate: false,
        bScrollInfinite: true,
        iScollLoadGap: 10,
        oLanguage: {
            sZeroRecords: "There are no records that match your search criterion",
        }
    }).makeEditable({ sUpdateURL: "/Home/UpdateData" });
});
</script>
<script type="text/javascript" charset="utf-8">
   $(documuent).ready(function () { var editChange = $('td').replaceWith('<td id = "@Html.ValueFor(x => x.name)" >'); });
</script>

你在第二块中有一个错别字:documuent而不是document

$(documuent).ready(function ()
// ----^     remove the extra "u"