Complete newbie but learning!
I have a php file presenting my menu ie
<li><a href="printers3.php" class="ajaxLink" name="Printer area" title="Printers3">Printers3</a></li>
and I am trying to include the output from printers3.php (the final line is echo $table; ) later on in the code within div id="MiddleColumnWrapper"
I have put the following code in my Head
<script>
$( function() {
$( ".ajaxLink" ).on( "click", function() {
var ajaxUrl = $( this ).attr( "href" );
$.get({
ajaxUrl,
function( response ) {
$( "#MiddleColumnWrapper" ) .html( response );
}
});
}
}
</script>
But at the moment I just get the result of $table in a new window. Have I missed something or just not on the right track? Thanks
Top code bit of the linking script
<script>
$( function() {
$( ".ajaxLink" ).on( "click", function() {
$.get({
url : 'printers3.php',
function( response ) {
$( "#MiddleColumnWrapper" ) .html( response );
}
});
}
}
</script>
</head>
<body>
<div id="SiteWrapper">
<?php
/* Output the header */
include 'includes/header.php';
?>
<div id="MiddleColumnWrapper">
<p>Middle column</p>
</div>