04 2017 档案

摘要:1..net ajax显示后台返回值 <script> $(document).ready(function () { $("#btn").click(function () { //var data = new string(); $.ajax({ type: "POST", //要用post方式 阅读全文
posted @ 2017-04-28 21:28 wskxy 阅读(578) 评论(1) 推荐(0) 编辑
摘要:1.加载外部文件 <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <!--防止乱码--><script src="js/jQuery.js"></script> <!--加载jQuery文 阅读全文
posted @ 2017-04-12 12:45 wskxy 阅读(246) 评论(0) 推荐(0) 编辑
摘要:1.父元素 $("span").parent() //定位到span的父元素 $("span").parents() //定位到span的所有父元素 $("span").parents("ul") //定位到span的ul父元素 $("span").parentsUntil("div"); //指定 阅读全文
posted @ 2017-04-11 22:57 wskxy 阅读(776) 评论(0) 推荐(0) 编辑
摘要:1.取值 $("#test").text() //取id=test里面的文字 $("#test").text("hello jquery") //设置id=test里面的文字 $("#test").html() //取id=test里面的html $("#test").html("<b>hello 阅读全文
posted @ 2017-04-09 23:01 wskxy 阅读(284) 评论(0) 推荐(0) 编辑
摘要:1.jquery隐藏and显示事件 $("p").hide(); //隐藏事件$("p").hide(1000); //1秒内缓慢隐藏$("p").show(); //显示事件$("p").toggle(); //在隐藏和显示中切换 隐藏后显示提示callback $("p").hide(funct 阅读全文
posted @ 2017-04-07 23:17 wskxy 阅读(1300) 评论(0) 推荐(0) 编辑
摘要:1.如何使用jQuery jQuery是一个快速、简洁的JavaScript框架,是继Prototype之后又一个优秀的JavaScript代码库(或JavaScript框架)。jQuery设计的宗旨是“write Less,Do More”,即倡导写更少的代码,做更多的事情。它封装JavaScri 阅读全文
posted @ 2017-04-07 20:15 wskxy 阅读(434) 评论(0) 推荐(0) 编辑
摘要:1.提示框 1)警告框 <script>function disp_alert(){alert("我是警告框!!")}</script> 2)确认框 function disp_alert(){var r=confirm("Press a button!");//弹出确认框if (r==true) 阅读全文
posted @ 2017-04-05 10:25 wskxy 阅读(262) 评论(0) 推荐(0) 编辑
摘要:1.节点-添加标签 <body><div id="div1"><p id="p1">这是一个段落。</p><p id="p2">这是另一个段落。</p></div><script>var para=document.createElement("p"); //创建一个文本节<p>var node=d 阅读全文
posted @ 2017-04-03 19:05 wskxy 阅读(261) 评论(0) 推荐(0) 编辑
摘要:1.try..catch.. <body><script>function myFunction(){try{ var x=document.getElementById("demo").value;//取值if(x=="") throw "值为空"; //返回错误提示if(isNaN(x)) th 阅读全文
posted @ 2017-04-02 15:38 wskxy 阅读(511) 评论(0) 推荐(0) 编辑
摘要:1.页面加载时向body加载文本、弹出框 <body> <script> document.write("<h1>JavaScript 会在页面加载时向 HTML 的 <body> 写文本</h1>"); </script> <script> alert("加载页面弹出框"); </script>< 阅读全文
posted @ 2017-04-02 12:39 wskxy 阅读(518) 评论(0) 推荐(0) 编辑
摘要:1.onclick事件 <button type="button" onclick="alert('Welcome!')">点击这里</button> <div onclick="alert('Welcome!')">点击这个div</div> 2.改变 HTML 内容 添加按钮,并调用onclic 阅读全文
posted @ 2017-04-01 23:04 wskxy 阅读(1531) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示