php - Replacing Div contents with results of an href click -


complete newbie learning!

i have php file presenting menu ie

<li><a href="printers3.php" class="ajaxlink" name="printer area" title="printers3">printers3</a></li> 

and trying include output printers3.php (the final line echo $table; ) later on in code within div id="middlecolumnwrapper"

i have put following code in head

<script> $( function() {     $( ".ajaxlink" ).on( "click", function() {         var ajaxurl = $( ).attr( "href" );         $.get({             ajaxurl,             function( response ) {                 $( "#middlecolumnwrapper" ) .html( response );             }         });     } } </script> 

but @ moment result of $table in new window. have missed or not on right track? thanks

top code bit of 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 header */     include 'includes/header.php'; ?>   <div id="middlecolumnwrapper"> <p>middle column</p> </div> 


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -