I have an index.php file that will load content based on a $_GET variable. So, it basically functions like this...
<?php
$problem_id = $_GET['problem_id'];
include('include/' . $problem_id . '.php');
?>
So, if a user clicks problem type #8, 8.php
will be included in the index.php file and it's content will be displayed.
The problem is that I'm now using AJAX to load 8.php
(or whatever file is selected). Some of the files depend on other javascript files (i.e. <script type="text/javascript" src="/include/js/api/utils.js"></script>
) to work. It seems that these dependencies are not being loaded when I run the index.php file via AJAX. If I run it with a normal $_GET variable in the URL (i.e. http://myscript.com?problem_id=8
), it works fine.
Is this a known issue with AJAX? Anyway around it?
Thanks.