How to make Jquery.load loads a page that also contains Javascript commands like an alert() inside of the page it is loading.
Hi
I'm trying to load a page that also contains JQuery/javascript Code.
For Example, I tried with a simple alert and it didn't pop up the alert.
Doesn't JQuery.load load javascript code?
Example Used:
- $(document).ready(function(){
- $('#mainContent').load("test.php");
- });
//TEST.PHP
- <?php echo "This message appears but not the Javascript Alert"; ?>
- <script type="text/javascript">
- alert("Testing the Ajax Load");
- </script>
The PHP tag appears in the load, but not the Javascript code.
Does someone know how to fix that?
Thanks!