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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -