Asp.Net4 Javascript/jquery缩小错误

Roh*_*ner 1 javascript jquery refactoring asp.net-mvc-4

我意识到这可能是愚蠢的,它可能是由于我缺乏javascript/jquery知识(在重新分解等方面...)

我正在我的页面上渲染一个JQGrid组件.

<script src="@System.Web.Optimization.BundleTable.Bundles.ResolveBundleUrl("~/JQGrid")" type="text/javascript"></script>
<script type="text/javascript">

    var colNames = ['S ID', 'Shift Description'];
    var colModel = [
            { name: 'S_ID', index: 'S_ID', key: true, width: 55, editable: false, hidden: true, search: false },
            { name: 'Shift_Description', index: 'Shift_Description', width: 100, align: "right", editable: true, editrules: { required: true }, formoptions: { rowpos: 1, colpos: 1}}];

    RenderJQGrid("#theGrid", '#pager', '@ViewBag.Title', 600, colNames, colModel, 'S_ID', null, null, null, '@Url.Action("GridData")', '@Url.Action("Add")', '@Url.Action("Edit")', '@Url.Action("Delete")', '@Url.Action("ExportToExcel")');

</script>
Run Code Online (Sandbox Code Playgroud)

在我的.js文件中,我只有这个.(它也是捆绑中唯一的文件)

function RenderJQGrid(GridID, PagerID, Title, ModalWidth, ColNames, ColModel, InitSortCol, OnLoadComplete, EditBeforeShowOptions, AddBeforeShowOptions, URL_get, URL_add, URL_edit, URL_delete, URL_excel) {

   ... Logic
}
Run Code Online (Sandbox Code Playgroud)

我虽然在小提琴手中收到这个错误.

/*缩小失败.返回未经授权的内容.

(1,10):运行时错误CSS1031:预期的选择器,找到'RenderJQGrid('

(1,10):运行时错误CSS1025:预期的逗号或开括号,找到'RenderJQGrid('

*/

我做错了什么/失踪了?它嵌入我的html页面时代码似乎很好吗?

Leo*_*eon 7

我遇到了类似的问题.我的问题是我使用StyleBundle来捆绑*.js文件