【发布时间】:2011-08-20 02:49:25
【问题描述】:
当我想加载包含一些 dojo 代码的页面时遇到问题。加载的页面不显示任何信息。
加载页面的 index.html 看起来像这样:
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js" djConfig="parseOnLoad: true">
//to fill
</script>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dijit/themes/claro/claro.css"/>
</head>
<body>
<div id="mainFrame">
<script type="text/javascript" >
$('#mainFrame').load('/Page.html');
</script>
</div>
</body>
<html>
我的第二页包含显示 DataGrid 的代码:Pahe.html
<html>
<head>
<link rel='stylesheet' type='text/css' href='http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojox/grid/resources/claroGrid.css'/>
<script type="text/javascript" >
dojo.require("dojox.grid.DataGrid");
dojo.require("dojo.data.ItemFileReadStore");
function prepare() {
var data0 =[{FristName:'jean',LastName:'edu',Course:'english'}];
var store0 = new dojo.data.ItemFileReadStore({
data: {
items: data0
}
});
var grid0 = new dojox.grid.DataGrid({
store: store0,
structure: [
{field: 'FirstName', name: 'FirstName', width:'auto'},
{field: 'LastName', name: 'LastName', width:'auto'},
{field: 'Course', name: 'Course', width:'auto'}
],
rowsPerPage: 20,
clientSort : true,
rowSelector : '10px'
}, "grid0");
grid0.startup();
}
dojo.addOnLoad(prepare);
</script>
</head>
<body>
<div id="grid0"/>
</body>
</html>
当我在浏览器中运行此代码时,我没有看到任何内容。但是,我使用 google chrome 前景工具看到浏览器加载了 dojo 的 dataGrid...
我认为这是 jquery 加载的问题,因为如果我在“Page.html”中添加代码以加载 dojo 的脚本,我可以看到一些东西...我客人说有问题jquery 和 dojo...
你能帮我解决这个问题吗?
提前致谢,
蝙蝠
【问题讨论】: