php - JQuery Ajax Not Showing Success Alert -
i trying jquery ajax work not getting success alert.
here code:
<script type="text/javascript"> $(document).ready(function( $('button').click(function() { $.ajax({ url: 'testing123.php', success: function(){ alert('this worked'); } }); return false; }); )); </script> <button>click here</button>
...then testing123.php file:
<?php echo 'hello there'; ?>
i have jquery library added too.
when click button should getting alert saying "this worked" right?
i don't understand why it's not happening...
any ideas why?
incorrect use of parantheses. corrected code:
$(document).ready(function() { $('button').click(function() { $.ajax({ url: 'testing123.php', success: function(){ alert('this worked'); } }); return false; }); });
Comments
Post a Comment