Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Place inside your head tag
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
- Place after your </body> tag
- <script type="text/javascript">
- $(document).ready(function() {
- $('form').submit(function(e){
- $.ajax({
- type: 'post',
- url: './folder_name/script_name.php', // or script_name.php
- data: $('form').serialize(),
- success: function(result) {
- $('#response').html("<b>" + result + "</b>")
- }
- });
- e.preventDefault(); //Doesn't allow page to refresh
- });
- });
- </script>
- Place wherever you want outcome to display in your <body>
- <div id="response"></div>
Add Comment
Please, Sign In to add comment