作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我又卡住了。我正在尝试将一些 javascript(数字微调器)加载到 Dojo 内容 Pane 中。我收到一条漂亮的丑陋消息:
Message: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)
这是我的代码。有什么想法吗?
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.4.0/dojo/dojo.xd.js" djConfig="isDebug: false, parseOnLoad: true"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.4/dijit/themes/tundra/tundra.css" />
<link rel="stylesheet" href="numberspinner.css" type="text/css" media="screen" />
<script type="text/javascript" src="numberspinner.js"></script>
<script type="text/javascript">
var init = function()
{ dojo.require('dijit.layout.ContentPane');
}
dojo.addOnLoad(init);
</script>
</head>
<body class="tundra">
<div id="notworkingtab" dojoType="dijit.layout.ContentPane" title="Location">
<script type="text/javascript">
var abc= new SpinControl();
abc.SetMaxValue(5);
abc.SetMinValue(0);
abc.SetCurrentValue(0);
abc.SetIncrement(0.5);
document.body.appendChild(abc.GetContainer());
abc.StartListening();
</script>
</div></div>
</body>
</html>
如果有人关心,我从这里得到了我的 numberspinner: http://www.switchonthecode.com/tutorials/javascript-controls-the-spin-control
它显示了数字微调器,但没有显示内容 Pane ,我得到了上面的错误...如果我将数字微调器从内容 Pane 中取出,则内容 Pane 工作正常。或者,如果我取出内容 Pane ,数字微调器工作正常。
谢谢格格格格格
最佳答案
我认为 dojox.layout.ContentPane
小部件就是您要找的东西。
dojox.layout.ContentPane
是 dijit.layout.ContentPane
的扩展,提供脚本执行等功能。
关于javascript - 在 Dojo ContentPane 中加载 javascript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2377331/
我是一名优秀的程序员,十分优秀!