Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <meta charset="utf-8">
  5.     <title>тест jawa скрипта и ajax</title>
  6.     <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
  7.     <script /*type="text/javascript" href="lellil.js"*/ >
  8.  
  9.     function funcBefore (){
  10.         $("#information").text ("Ожидание данных");
  11.     }
  12.  
  13. function funcSuccess (data){
  14.         $("#information").text ("data");
  15.     }
  16.  
  17.     $(document).ready (function (){
  18.         $("#load").bind("click", function(){
  19.             var admin = "Admin"
  20.             $.ajax({
  21.                 url: "content.php",
  22.                 type: "POST",
  23.                 data: ({name: admin, number: 5}),
  24.                 dataType: "html",
  25.                 beforeSend: funcBefore,
  26.                 success: funcSuccess
  27.             });
  28.         });
  29.     });
  30.     </script>
  31. </head>
  32. <body>
  33.  
  34. <p id="load" style="cursor:pointer">Загрузить данные</p>
  35. <div id="Information"></div>
  36. </body>
  37. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement