gpt4 book ai didi

javascript - 在 Dojo ContentPane 中加载 javascript

转载 作者:行者123 更新时间:2023-11-30 08:16:48 24 4
gpt4 key购买 nike

我又卡住了。我正在尝试将一些 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.ContentPanedijit.layout.ContentPane 的扩展,提供脚本执行等功能。

关于javascript - 在 Dojo ContentPane 中加载 javascript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2377331/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com