I have a page like this that page1.php codes will load with ajax in that:
...
<div id="myContent" >
<!-- ajax content load here -->
</div>
...
and my ajax codes are:
$.ajax({
type: 'post',
url: 'codes/page.php',
async: false,
data: formDatas
, success: function (response) {
document.getElementById('myContent').innerHTML = response; // response contains page1.php codes
}
}
});
and these datas will load from page1.php:
<script>
alert("hello");
</script>
<div>
...
</div>
Now my problem is that when I load page1.php directly, this alerts "hello". But when I load this contents via ajax , scripts not works and nothing alerted
How do I do to running these scripts after loading datas in myContent div.
thank you all