It maybe a stupid coding issue, but I have googled since a couple days, tried to rebuild my code a few times, and I always end up in the same situation.
My page structure is something like that:
/controller/
|--Menu_Controller.php
/pages/
|--ContentA.php
|--ContentB.php
/index.php
I have an ajax script that calls and refreshes the Content area in my Index.php
<script type="text/javascript" language = "javascript">
(function($)
{
$(document).ready(function()
{
var mid = "<?php echo $MainMenu;?>";
var sid = "<?php echo $SubMenu;?>";
$.ajaxSetup(
{
cache: false,
type: 'post',
data: {mid:mid,sid:sid,},
});
var $container = $("#Content");
$container.load("controller/Menu_Controller.php");
var refreshId = setInterval(function()
{
$container.load('controller/Menu_Controller.php');
}, 5000);
});
})(jQuery);
</script>
And in my loaded content, I have a form which should triggers another ajax script when I hit the submit button.
<script>
// Attach a submit handler to the form
$( "#searchForm" ).submit(function( event ) {
alert('Test');
});
});
</script>
But only the one or the other ajax works :( I'm sure I placed the code maybe at the wrong spots or something stupid.
Thanks for your help! Alex
</div>