我的 jqgrid 根本没有显示。我是新来的,所以任何解释都值得赞赏我的页面在下面,据我所知,我有所有必要的文件等,但在 Chrome 中没有一个是 404ed。我应该补充一点,我正在使用带有 Spring 的 Eclipse。我在 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>
我看到的错误是:
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