I have the following in my div
<script>
function newfunc()
{
alert("here");
}
</script>
<button type="button" onclick="newfunc()">Press me</button>
It works fine in IE and FF, but in Safari (at least Safari 4.0.5) it says: “ReferenceError cannot find a variable” - now the content was loaded in the DIV dynamically and it seems like Safari cannot see the function definitions in it DIV - however, if I put the function newfunc()on the main HTML page (i.e. not in the DIV), then clicking the button calls the function.
As if Safari doesn't see the Javascript functions added to the DIV.
Any help would be appreciated.
Adam
source
share