Great for ajax function that take too long!
This one shows 20 seconds..I think!
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"); $.ajax({ url: "count1.php", //this file will not produce anything as its not there? timeout: 20000, type: 'POST', error:function(){ alert("Oops, I could find the file, so i will show this") }, success: function(data){ $("#formResponse").html(data); } }); //end ajax }); //end click }); //end ready </script> <input type="text" value="mystuff" id="plate" name="plate"> <input type="button" value="submit" id="submitme"> <div id="formResponse"></div> |