0
CSWING引用jsFiddle的[code] [1], 爲什麼這會在dojo.js中指示「TypeError:this.domNode爲null(26超出範圍15) 。簡單的dojo示例錯誤:this.domNode爲空
這裏是CSWING複製我的代碼,用於學習和測試,
<!DOCTYPE html>
<html>
<head>
<style>
html, body /*standard layout for every dojo webpage*/
{
width: 100%;
height: 100%;
padding: 0px;
margin: 5px;
overflow: hidden;/*no scrollbar used*/
}
#standby {
position: absolute;
top: 50%;
left: 50%;
width:32px;
height:32px;
margin-top: -16px;
margin-left: -16px;
/*
width: 300px;
height: 300px;
background-color: #e7e7e7;
*/
}
</style>
<link rel="stylesheet" href="../dojo1_8/dijit/themes/claro/claro.css">
<script>dojoConfig = {parseOnLoad: true}</script>
<script src="../dojo1_8/dojo/dojo.js"></script>
</head>
<body class="claro">
<div id="standby">
<div id="btn" data-dojo-type="dijit.form.Button" data-dojo-props="label:
Go'"></div>
</div>
<script>
require(["dojox/widget/Standby","dijit/form/Button",
"dojo/store/Memory",'dijit/form/ComboBox',
"dojo/on", "dojo/domReady!"],
function(Standby, Button, Memory, on, ComboBox)
{
var standby = new Standby
({
id: "standbyObj",
target: "btn",
color: "transparent",
zindex: "auto",
duration: "1000"
});
dojo.body().appendChild(standby.domNode);
standby.startup();
on(dojo.byId('btn'), 'click', function()
{
standby.show();
//simulate a request. hide the timeout in 5 seconds
setTimeout(function()
{
standby.hide();
}, 5000);
});
});
</script>
</body>
</html>
請指教。 感謝 克萊門特 [1]:http://jsfiddle.net/cswing/253Te/
不確定你的意思。在你的小提琴中,我看到旋轉線圈在按鈕上,5秒後隱藏。我在控制檯中看不到任何錯誤。 – Tommi
你使用什麼瀏覽器/版本? –
FireFox 22.0和FireBug 11.1.4。我複製了這段代碼,並在修改之前嘗試進行測試。我還沒有修改它。 @CraigSwing我能夠在jsFiddle中查看你的代碼,但不能在FireFox中複製代碼。 – user1739825