call function with dijit.layout.ContentPane onload?
Is it call tes开发者_高级运维t() of sub.htm from index.htm by this code when doing very?
Thank you very much.
index.htm
<div dojoType="dijit.layout.ContentPane" id="subFrame" region="left" href="sub.htm">
<script type="dojo/connect" event="onLoad">
// this call test()
</script>
</div>
sub.htm
<script type="text/javascript">
function test() {
alert("success");
}
</script>
<table>
<tr>
<td></td>
</tr>
</table>
For what I know you can't call a javascript inside a content pane unless you use <script type="dojo/method">
. try to replace the text/javascript type in sub htm with "dojo/method".
i think it should be fine if you swap the function into a variable declaration style:
var test = new function(){ alert("success") };
精彩评论