开发者

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") };

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜