Have the issue here when I dynamically load a php page the external JS file linked into that PHP pages doesn't seem to take effect. There is know JS code in the HTML file to call functions, the JS files does all the work by modifying certain tags.
HTML page will load the PHP file which is linked to the JS script. Relevant code below.
This does work if loaded directly, just not when loaded dynamically I've similar issues like this in the past where the solution was to use the call back feature when loading the content however since all the JS is in a external file not sure of the best method.
HTML code to load PHP file
<script>
$(document).ready (function() {
$('#test').click(function(event) {
$('#content').empty();
$('#content').load('view/search.php');
})
})
</script>
How the JS is linked into the PHP file
<script type="text/javascript" src="edit.js"></script>
Again all the code works when loading the PHP page directly.
Many Thanks