jquery.html 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Jquery</title>
  6. <script src="js/jquery.min.js" ></script>
  7. <style>
  8. .test{
  9. }
  10. .respone {
  11. width: 800px; height: 390px; border: 1px solid red; overflow: auto;
  12. }
  13. </style>
  14. </head>
  15. <body>
  16. <div style="width: 800px; margin: 0 auto">
  17. <button class="test"> sendData </button>
  18. <button> cleanData </button>
  19. <div id="ajax-respone" class="respone">
  20. </div>
  21. </div>
  22. <script>
  23. // $("button:first").click(function(event){
  24. // // $.get("/day13_war_exploded/ajaxRequest", function(data){
  25. // // $("#ajax-respone").append( data )
  26. // // })
  27. // $.post("/day13_war_exploded/ajaxRequest",
  28. // {"name":"zhangsan"}, function(data){
  29. // $("#ajax-respone").append( data )
  30. // }
  31. // )
  32. // $(this).css("position", "absolute").animate({
  33. // opacity: 0.85,
  34. // left: '+=650',
  35. // height: '+=850'
  36. // }, 35000, function() {
  37. // console.log("动画播放完毕")
  38. // })
  39. //
  40. // })
  41. // $("button:first").click(function(event){
  42. // console.log( "发送数据" )
  43. // })
  44. // $("button").last().click(function(){
  45. // $(this).text("改名字了")
  46. // })
  47. // $("button:last").click(function(event){
  48. // console.log( "清空数据" )
  49. // })
  50. //$("button:last").hidden();
  51. // console.log( $("button:first").hasClass("test") )
  52. // console.log( $("button:last").hasClass("test") )
  53. /**
  54. * ready 函数在 Jquery 开发中很重要
  55. * 当我们 对某些元素进行事件绑定的时候, 这个元素必须存在才能绑定成功
  56. * 所以 我们很多事件 必须是 页面已经初始化完成 才能操作
  57. * 这样 我们就需要使用 ready 函数了
  58. */
  59. // $("html").ready(function(){
  60. // console.log("页面准备完成")
  61. // })
  62. //$("button:last").slideToggle()
  63. </script>
  64. </body>
  65. </html>