wglass
28 Nov 2007, 4:23 PM
Hi,
I have an app which dynamically loads content into a div with ext-js. When a <script> tag is included, any functions within the script tag cannot be called. This works in IE6, IE7, FF 2, but not Safari 3.
The function (it's part of a border layout) that loads the content is here:
loadContent: function(page)
{
this.contentPanel.load(
{
url: page,
text: "Loading...",
timeout: 30,
scripts: true
});
The script (within the HTML that is loaded) is:
<script type="text/javascript">
function validate()
{
alert('test');
return true;
}
</script>
If I try to call it from a button it fails.
<INPUT TYPE="button"NAME="submitsurvey" VALUE="Submit Survey" id="submitsurvey" onClick="return validate();" />
Interestingly, if I include an Ext.onReady within the script tag it is executed. But I can't seem to access the function from a button on the page.
If I move the function to the parent file it will get executed. But it has dynamically generated info in it so I want to be included in the AJAX loaded section.
Again, this works fine in Firefox or IE.
Would appreciate any tips.
Thanks, WILL
I have an app which dynamically loads content into a div with ext-js. When a <script> tag is included, any functions within the script tag cannot be called. This works in IE6, IE7, FF 2, but not Safari 3.
The function (it's part of a border layout) that loads the content is here:
loadContent: function(page)
{
this.contentPanel.load(
{
url: page,
text: "Loading...",
timeout: 30,
scripts: true
});
The script (within the HTML that is loaded) is:
<script type="text/javascript">
function validate()
{
alert('test');
return true;
}
</script>
If I try to call it from a button it fails.
<INPUT TYPE="button"NAME="submitsurvey" VALUE="Submit Survey" id="submitsurvey" onClick="return validate();" />
Interestingly, if I include an Ext.onReady within the script tag it is executed. But I can't seem to access the function from a button on the page.
If I move the function to the parent file it will get executed. But it has dynamically generated info in it so I want to be included in the AJAX loaded section.
Again, this works fine in Firefox or IE.
Would appreciate any tips.
Thanks, WILL