Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Test</title>
- </head>
- <body>
- <h2>AJAX</h2>
- <button type="button">Request data</button>
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.12.1/jquery.min.js"></script>
- <script>
- $(document).ready( function() {
- $('button').click( function() {
- $.ajax({
- url : 'response.php',
- dataType : 'text',
- success : function(data) {
- $('h2').css('color', data);
- }
- });
- });
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement