![](/img/trans.png)
[英]using onShow and onLoad for dijit.layout.ContentPane created programatic
[英]call function with dijit.layout.ContentPane onload?
这样做时是否通过此代码从index.htm调用sub.htm的test()?
非常感谢你。
索引
<div dojoType="dijit.layout.ContentPane" id="subFrame" region="left" href="sub.htm">
<script type="dojo/connect" event="onLoad">
// this call test()
</script>
</div>
htm
<script type="text/javascript">
function test() {
alert("success");
}
</script>
<table>
<tr>
<td></td>
</tr>
</table>
据我所知,除非使用<script type="dojo/method">
否则您无法在内容窗格内调用javascript。 尝试用“ dojo / method”替换htm中的text / javascript类型。
我认为如果将函数交换为变量声明样式应该会很好:
var test = new function(){alert(“ success”)};
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.