Got : one html page with a DIV in it.
Works : I can load external files into that DIV using AJAX and a backend PHP script - say some html formatted stuff.
But : If the external file also contains some javascript code, then the AJAX'ed code won't run.
Example : Say a file I AJAX into my div looks like this
I get an error when clicking the button.... this is confusing. How can I get this working?
Thanks
Works : I can load external files into that DIV using AJAX and a backend PHP script - say some html formatted stuff.
But : If the external file also contains some javascript code, then the AJAX'ed code won't run.
Example : Say a file I AJAX into my div looks like this
Code:
<script>
function tryme() {
alert('Hello you!');
}
</script>
<button onclick="tryme()">Try me!</button>
I get an error when clicking the button.... this is confusing. How can I get this working?
Thanks