12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Jquery</title>
- <script src="js/jquery.min.js" ></script>
- <style>
- .test{
- }
- .respone {
- width: 800px; height: 390px; border: 1px solid red; overflow: auto;
- }
- </style>
- </head>
- <body>
- <div style="width: 800px; margin: 0 auto">
- <button class="test"> sendData </button>
- <button> cleanData </button>
- <div id="ajax-respone" class="respone">
- </div>
- </div>
- <script>
- // $("button:first").click(function(event){
- // // $.get("/day13_war_exploded/ajaxRequest", function(data){
- // // $("#ajax-respone").append( data )
- // // })
- // $.post("/day13_war_exploded/ajaxRequest",
- // {"name":"zhangsan"}, function(data){
- // $("#ajax-respone").append( data )
- // }
- // )
- // $(this).css("position", "absolute").animate({
- // opacity: 0.85,
- // left: '+=650',
- // height: '+=850'
- // }, 35000, function() {
- // console.log("动画播放完毕")
- // })
- //
- // })
- // $("button:first").click(function(event){
- // console.log( "发送数据" )
- // })
- // $("button").last().click(function(){
- // $(this).text("改名字了")
- // })
- // $("button:last").click(function(event){
- // console.log( "清空数据" )
- // })
- //$("button:last").hidden();
- // console.log( $("button:first").hasClass("test") )
- // console.log( $("button:last").hasClass("test") )
- /**
- * ready 函数在 Jquery 开发中很重要
- * 当我们 对某些元素进行事件绑定的时候, 这个元素必须存在才能绑定成功
- * 所以 我们很多事件 必须是 页面已经初始化完成 才能操作
- * 这样 我们就需要使用 ready 函数了
- */
- // $("html").ready(function(){
- // console.log("页面准备完成")
- // })
- //$("button:last").slideToggle()
- </script>
- </body>
- </html>
|