Jquery jqgrid不显示

Jquery jqgrid不显示,jquery,jqgrid,Jquery,Jqgrid,我的jqgrid根本不显示。我在这方面是新手,所以任何解释都很感谢,我的页面在下面,据我所知,我有所有必要的文件等,没有一个是用Chrome 404发布的。我应该补充一点,我正在使用Eclipse和Spring。我在Chrome中看到的错误跟在底部的页面信息后面。它们似乎只是几个语法错误,但我有一种错觉 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ page session="false

我的jqgrid根本不显示。我在这方面是新手,所以任何解释都很感谢,我的页面在下面,据我所知,我有所有必要的文件等,没有一个是用Chrome 404发布的。我应该补充一点,我正在使用Eclipse和Spring。我在Chrome中看到的错误跟在底部的页面信息后面。它们似乎只是几个语法错误,但我有一种错觉

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page session="false" %>
<html>
<head>
    <link rel="stylesheet" type="text/css" media="screen" href="resources/jqgrid/css/smoothness/ui-lightness/jquery-ui-1.10.0.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="resources/jqgrid/css/ui.jqgrid.css" />

<script type="text/javascript" src="resources/jqgrid/js/jquery/jquery-1.4.2.min.js"></script>
<!--  
<script type="text/javascript">
    var $jq = jQuery.noConflict();
</script>
-->
<script type="text/javascript" src="resources/js/jquery/jquery-ui-1.8.6.custom.min.js"></script> 
<script type="text/javascript" src="resources/jqgrid/js/grid.locale-en.js" ></script>
<script type="text/javascript" src="resources/jqgrid/js/jquery.jqGrid.min.js"></script>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

 <script type="text/javascript">
$(function() {
    $("#grid").jqGrid({
        url:'/listgrid',
        datatype: 'json',
        mtype: 'GET',
        colNames:['Title', 'Description', 'Release Year'],
        colModel:[
            {name:'title',index:'title', width:55,editable:false,editoptions:{readonly:true,size:10},hidden:true},
            {name:'description',index:'description', width:100,editable:true, editrules:{required:true}, editoptions:{size:10}},
            {name:'release_year',index:'release_year', width:100,editable:true, editrules:{required:true}, editoptions:{size:10}}
        ],
        postData: { 
        },
        rowNum:20,
        rowList:[20,40,60],
        height: 200,
        autowidth: true,
        rownumbers: true,
        pager: '#pager',
        sortname: 'title',
        viewrecords: true,
        sortorder: "asc",
        caption:"Movies",
        emptyrecords: "Empty records",
        loadonce: false,
        loadComplete: function() {
        },
        jsonReader : {
            root: "rows",
            page: "page",
            total: "total",
            records: "records",
            repeatitems: false,
            cell: "cell",
            id: "id"
        }
    });


});
  </script>


<title>Home</title>
   </head>
   <body>


<h1>
Hello  world!  
</h1>

<P>  The time on the server is ${serverTime}. </P>

<p>JqGrid - Spring 3 MVC Integration Tutorial</p>
<div id="jqgrid">
<table id="grid"></table>
<div id="pager"></div>
</div>
</body>
</html>

$(函数(){
$(“#网格”).jqGrid({
url:“/listgrid”,
数据类型:“json”,
mtype:'获取',
colNames:['Title','Description','Release Year'],
colModel:[
{名称:'title',索引:'title',宽度:55,可编辑:false,编辑选项:{readonly:true,size:10},隐藏:true},
{name:'description',index:'description',width:100,可编辑:true,editrules:{required:true},editoptions:{size:10},
{name:'release_year',index:'release_year',width:100,editrules:{required:true},editoptions:{size:10}
],
postData:{
},
rowNum:20,
行列表:[20,40,60],
身高:200,
自动宽度:正确,
行数:对,
寻呼机:“#寻呼机”,
sortname:“标题”,
viewrecords:是的,
分拣员:“asc”,
描述:“电影”,
emptyrecords:“空记录”,
loadonce:false,
loadComplete:function(){
},
jsonReader:{
根:“行”,
第页:“第页”,
总计:“总计”,
记录:“记录”,
重复项:false,
细胞:“细胞”,
id:“id”
}
});
});
家
你好,世界!

服务器上的时间为${serverTime}

JqGrid-Spring3MVC集成教程

我看到的错误是:

Resource interpreted as Script but transferred with MIME type text/html:
"http://localhost:8080/movies/resources/jqgrid/js/jquery.jqGrid.min.js". localhost:8
Resource interpreted as Stylesheet but transferred with MIME type text/html:
"http://localhost:8080/movies/resources/jqgrid/css/ui.jqgrid.css". localhost:6
Resource interpreted as Stylesheet but transferred with MIME type text/html:
"http://localhost:8080/movies/resources/jqgrid/css/smoothness/ui-lightness/jquery-ui-1.10.0.custom.css". localhost:5
Resource interpreted as Script but transferred with MIME type text/html: "http://localhost:8080/movies/resources/jqgrid/js/jquery/jquery-1.4.2.min.js". localhost:8
 Uncaught SyntaxError: Unexpected token < :8080/movies/resources/jqgrid/js/jquery/jquery-1.4.2.min.js:3
  Resource interpreted as Script but transferred with MIME type text/html: "http://localhost:8080/movies/resources/js/jquery/jquery-ui-1.8.6.custom.min.js". localhost:8 Uncaught SyntaxError: Unexpected token < :8080/movies/resources/js/jquery/jquery-ui-1.8.6.custom.min.js:3
  Resource interpreted as Script but transferred with MIME type text/html: "http://localhost:8080/movies/resources/jqgrid/js/grid.locale-en.js". localhost:8
   Uncaught SyntaxError: Unexpected token < :8080/movies/resources/jqgrid/js/grid.locale-en.js:3
  Uncaught SyntaxError: Unexpected token < jquery.jqGrid.min.js:3
  Uncaught ReferenceError: $ is not defined localhost:21
资源解释为脚本,但使用MIME类型text/html传输:
"http://localhost:8080/movies/resources/jqgrid/js/jquery.jqGrid.min.js". 本地主机:8
解释为样式表但使用MIME类型text/html传输的资源:
"http://localhost:8080/movies/resources/jqgrid/css/ui.jqgrid.css". 本地主机:6
解释为样式表但使用MIME类型text/html传输的资源:
"http://localhost:8080/movies/resources/jqgrid/css/smoothness/ui-lightness/jquery-ui-1.10.0.custom.css”。本地主机:5
解释为脚本但使用MIME类型text/html传输的资源:http://localhost:8080/movies/resources/jqgrid/js/jquery/jquery-1.4.2.min.js”。本地主机:8
未捕获的语法错误:意外标记<:8080/movies/resources/jqgrid/js/jquery/jquery-1.4.2.min.js:3
解释为脚本但使用MIME类型text/html传输的资源:http://localhost:8080/movies/resources/js/jquery/jquery-ui-1.8.6.custom.min.js”。localhost:8未捕获的语法错误:意外标记<:8080/movies/resources/js/jquery/jquery-ui-1.8.6.custom.min.js:3
解释为脚本但使用MIME类型text/html传输的资源:http://localhost:8080/movies/resources/jqgrid/js/grid.locale-en.js”。本地主机:8
未捕获的语法错误:意外标记<:8080/movies/resources/jqgrid/js/grid.locale en.js:3
未捕获的语法错误:意外标记
您有一个语法错误,通常这会阻止其他脚本运行预期的脚本,修复错误&您可能会更幸运。

我自己不使用Eclipse或Spring。所以我帮不了你多少忙。然而,你可以在你发布的代码中看到一些问题。例如,您使用的结构如下



为什么您认为您的代码应该被解释为XHTML?您必须在
之前添加额外的,以强制将代码解释为XHTML而不是HTML。例如,您可以包括


在此之后,我建议您将JavaScript代码始终置于
/
和
/]>


//
在这种情况下,您将确保可以在XHTML页面上包含任何JavaScript代码

此外,在不同版本的jQueryUI之间混合使用是非常糟糕的。您可以将
jquery-ui-1.10.0.custom.css
jquery-ui-1.8.6.custom.min.js
一起使用。此外,您还使用非常旧的jQuery版本(
jQuery-1.4.2.min.js
)。您应该准确地阅读哪个版本的jQuery UI将支持什么。例如,jQueryUI1.10.0和jQueryUI1.9.2支持版本为1.6及更高版本的jQuery。如果确实需要使用旧的jQuery 1.4.2版本,那么必须使用jQueryUI1.8.x。在这种情况下,我建议您使用


我自己不使用Eclipse或Spring。因此,在设置错误的MIME类型text/html时,我无法为您提供更多帮助。您应该更仔细地将正确运行的代码与当前存在问题的代码进行比较。或者,您应该在stackoverflow上提出新问题,但使用另一个标记。

谢谢,但我在代码中没有看到任何语法错误。我实际上是从另一个运行的应用程序中复制了这一部分,所以这有点神秘。它在您的输出“Uncaught SyntaxError:Unexpected token