views:

542

answers:

2

Hi,

Is it call test() 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>
A: 

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".

sica07
thanks! sica07.
ayumi
A: 

i think it should be fine if you swap the function into a variable declaration style:

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

michael lowden
thanks! michael lowden.
ayumi