I have following pages:
popup.html
<script type="text/javascript">
//requires
function doFunction(){
alert("hi");
}
</script>
<button dojoType="dijit.form.Button" type="button" onClick="doFunction()">Click me</button>
main.html
<script type="text/javascript">
function showPopUp(){
theContentPane.set("Href", "popup.html");
theModal.show();
}
</script>
<div dojoType="dijit.Dialog" jsId="theModal">
<div dojoType="dojox.layout.ContentPane" jsId="theContentPane">
</div>
</div>
<button dojoType="dijit.form.Button" type="button" onClick="showPopUp()">open popup</button>
when I press the button "open popup" in main.html the pop opened, and everything seems to be fine. but when I pression the button of the popup "click me" firebug shows: doFunction is not defined
is it problem of scope? how can I make the popup.html call funciones which is inside popup.html
after I post it found the answer…. the code I posted actually works, mine didn’t work because I had
instead of
since dijit.layout.ContentPanel does instantiate dojo widgets but does not execute javascripts and dojox.layout.ContentPane does…