1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
<script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script> $(document).ready(function(){ $.get('getresults.php?searchData=', function(returnData) { /* If the returnData is empty then display message to user * else our returned data results in the table. */ if (!returnData) { $('#results').html('<p style="padding:5px;">Search term entered does not return any data.</p>'); } else { $('#results').html(returnData); } }); }); </script> <div id="results">hi</div> |
getresults.php
1 2 3 4 5 6 7 8 |
<?php echo "Yes it worked"; ?> |
This last script would run a particular mysql search and echo results. It has been simplified to understand the process of connecting by jquery.