If the file taxi.php has just the words “Hello I’m from taxi”, then that’s what will come back in this script below. (Its like magic!)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
<script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#submitme").click(function() { alert("hi"); $.post("taxi.php", $("#plate").serialize(), function(data) { $("#formResponse").html(data); } ); return false; }); }); </script> <input type="text" value="mystuff" id="plate" name="plate"> <input type="button" value="submit" id="submitme"> <div id="formResponse"></div> |