0

是不是通过这段代码从 index.htm 调用 sub.htm 的 test() ?

非常感谢。

索引.htm

<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>
4

2 回答 2

1

据我所知,除非您使用<script type="dojo/method">. 尝试将 sub htm 中的 text/javascript 类型替换为“dojo/method”。

于 2009-10-30T11:51:17.383 回答
0

我认为如果将函数交换为变量声明样式应该没问题:

var test = new function(){ alert("success") };

于 2009-11-01T22:19:34.453 回答