How to make Jquery.load loads a page that also contains Javascript commands like an alert() inside of the page it is loading.

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:
  1.   $(document).ready(function(){
  2.         $('#mainContent').load("test.php");
  3. });



//TEST.PHP

  1. <?php echo "This message appears but not the Javascript Alert"; ?>
  2. <script type="text/javascript">
  3.         alert("Testing the Ajax Load");
  4. </script>


The PHP tag appears in the load, but not the Javascript code.

Does someone know how to fix that?

Thanks!