Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript JQGrid for JQuery只提供了一个空白页面_Javascript_Jquery_Jqgrid - Fatal编程技术网

Javascript JQGrid for JQuery只提供了一个空白页面

Javascript JQGrid for JQuery只提供了一个空白页面,javascript,jquery,jqgrid,Javascript,Jquery,Jqgrid,我希望有人能帮我,因为我整个上午都在绞尽脑汁(我肯定这是我做的蠢事) 无论如何,我希望我们其中一个系统的数据显示在JQGrid中,我希望从一个页面加载数据,所以我使用StringXML功能,但是我遇到了问题,页面上没有显示任何内容,如果包含警报,则会显示该警报,但即使所有文件加载正常且错误控制台中没有错误,网格也不会显示 我已经在下面粘贴了代码,有什么明显的错误吗 <HTML><HEAD> <script type='text/javascript' src='in

我希望有人能帮我,因为我整个上午都在绞尽脑汁(我肯定这是我做的蠢事)

无论如何,我希望我们其中一个系统的数据显示在JQGrid中,我希望从一个页面加载数据,所以我使用StringXML功能,但是我遇到了问题,页面上没有显示任何内容,如果包含警报,则会显示该警报,但即使所有文件加载正常且错误控制台中没有错误,网格也不会显示

我已经在下面粘贴了代码,有什么明显的错误吗

<HTML><HEAD>
<script type='text/javascript' src='includes/jquery/jquery-1.7.2.min.js'></script>
<script type='text/javascript' src='includes/jquery/jquery-ui-1.8.22.custom.min.js'></script>
<link rel="stylesheet" type="text/css" media="screen" href="includes/jquery/jquery-ui-1.8.22.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="includes/grid/ui.jqgrid.css" />
<script src="includes/grid/js/il8n/grid.locale-en.js" type="text/javascript"></script>
<script src="includes/grid/js/jquery.jqGrid.min.js" type="text/javascript"></script>
</HEAD><BODY>
<SCRIPT>var liststr = "<?xml version='1.0' encoding='utf-8'?><GRIDDATA><ROWS>
<ROW><CELL>Fri 24 Aug 2012 17:19</CELL><CELL>5</CELL></ROW>
<ROW><CELL>Fri 24 Aug 2012 18:20</CELL><CELL>5</CELL></ROW>
<ROW><CELL>Fri 24 Aug 2012 19:21</CELL><CELL>5</CELL></ROW>
<ROW><CELL>Fri 24 Aug 2012 20:22</CELL><CELL>5</CELL></ROW>
<ROW><CELL>Fri 24 Aug 2012 21:23</CELL><CELL>5</CELL></ROW>
<ROW><CELL>Fri 24 Aug 2012 22:24</CELL><CELL>5</CELL></ROW>
<ROW><CELL>Fri 24 Aug 2012 23:25</CELL><CELL>5</CELL></ROW>
<ROW><CELL>Sat 25 Aug 2012 00:26</CELL><CELL>5</CELL></ROW>
<ROW><CELL>Sat 25 Aug 2012 01:27</CELL><CELL>5</CELL></ROW>
<ROW><CELL>Sat 25 Aug 2012 02:28</CELL><CELL>5</CELL></ROW>
<ROW><CELL>Sat 25 Aug 2012 03:29</CELL><CELL>5</CELL></ROW>
</ROWS></GRIDDATA>";

jQuery(document).ready(function() {
            jQuery("#gridview").jqGrid({ 
            datatype: 'xmlstring', datastr: 'liststr', height: 250, 
            colNames:['Date', 'Lic1'], 
            colModel:[    
                {name:'date',index:'date', width:90, sorttype:'date'}, {name:'30300', index:'30300', width: 200, sorttype:'int'}],
            multiselect: true,
            caption: "Licenses in Use"
            })
        ;}
</SCRIPT>

var liststr=”
2012年8月24日星期五17:195
2012年8月24日星期五18:205
2012年8月24日星期五19:215
2012年8月24日星期五20:225
2012年8月24日星期五21:235
2012年8月24日星期五22:245
2012年8月24日星期五23:255
2012年8月25日星期六00:265
2012年8月25日星期六01:275
2012年8月25日星期六02:285
2012年8月25日星期六03:295
";
jQuery(文档).ready(函数(){
jQuery(“#gridview”).jqGrid({
数据类型:“xmlstring”,数据类型:“liststr”,高度:250,
colNames:['Date','Lic1'],
colModel:[
{名称:'date',索引:'date',宽度:90,排序类型:'date'},{名称:'30300',索引:'30300',宽度:200,排序类型:'int'},
多选:对,
标题:“正在使用的许可证”
})
;}

1:你应该有一个
和 第二:在:

jQuery(document).ready(function() {
            jQuery("#gridview").jqGrid({ 
            datatype: 'xmlstring', datastr: 'liststr', height: 250, 
            colNames:['Date', 'Lic1'], 
            colModel:[    
                {name:'date',index:'date', width:90, sorttype:'date'}, {name:'30300', index:'30300', width: 200, sorttype:'int'}],
            multiselect: true,
            caption: "Licenses in Use"
            })
        ;}
您错过了最新的括号“jQuery(document).ready”(“因此,您的代码应该如下所示:

jQuery(document).ready(function() {
            jQuery("#gridview").jqGrid({ 
            datatype: 'xmlstring', datastr: 'liststr', height: 250, 
            colNames:['Date', 'Lic1'], 
            colModel:[    
                {name:'date',index:'date', width:90, sorttype:'date'}, {name:'30300', index:'30300', width: 200, sorttype:'int'}],
            multiselect: true,
            caption: "Licenses in Use"
            });
        });

我没有试过,但可能是大写的标记名吗?非常感谢缺少的括号肯定没有帮助,我最终发现了数据问题,需要大家注意的是确保行和单元格标记是小写的!!!!如果你像我的jqGrid一样使用大写,它会忽略XMLSTRING数据。