element table查询时,table内显示加载中,返回空数据时显示暂无数据(即empty-text的使用)

1.先来看下table内empty-text的含义

 2.

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Javascript小技巧一箩筐 事件源对象 event.srcElement.tagName event.srcElement.type 捕获释放 event.srcElement.setCapture(); event.srcElement.releaseCapture(); 事件按键 event.keyCode event.shiftKey event.altKey event.ctrlKey 事件返回值 event.returnValue 鼠标位置 event.x event.y 窗体活动元素 document.activeElement 绑定事件 document.captureEvents(Event.KEYDOWN); 访问窗体元素 document.all("txt").focus(); document.all("txt").select(); 窗体命令 document.execCommand 窗体COOKIE document.cookie 菜单事件 document.oncontextmenu 创建元素 document.createElement("SPAN"); 根据鼠标获得元素: document.elementFromPoint(event.x,event.y).tagName=="TD document.elementFromPoint(event.x,event.y).appendChild(ms) 窗体图片 document.images[索引] 窗体事件绑定 document.onmousedown=scrollwindow; 元素 document.窗体.elements[索引] 对象绑定事件 document.all.xxx.detachEvent("onclick",a); 插件数目 navigator.plugins 取变量类型 typeof($js_libpath) == "undefined" 下拉框 下拉框.options[索引] 下拉框.options.length 查找对象 document.getElementsByName("r1"); document.getElementById(id); 定 timer=setInterval("scrollwindow()",delay); clearInterval(timer); UNCODE编码 escape() ,unescape 父对象 obj.parentElement(dhtml) obj.parentNode(dom) 交换表的行 TableID.moveRow(2,1) 替换CSS document.all.csss.href = "a.css"; 并排显示 display:inline 隐藏焦点 hidefocus=true 根据宽度换行 style="word-break:break-all" 自动刷新 <meta HTTP-EQUIV="refresh" CONTENT="8;URL=http://c98.yeah.net"> 简单邮件 <a href="mailto:[email protected]?subject=ccc&body=xxxyyy"> 快速转到位置 obj.scrollIntoView(true) 锚 <a name="first"> <a href="#first">anchors</a> 网页传递参数 location.search(); 可编辑 obj.contenteditable=true 执行菜单命令 obj.execCommand 双字节字符 /[^x00-xff]/ 汉字 /[u4e00-u9fa5]/ 让英文字符串超出表格宽度自动换行 word-wrap: break-word; word-break: break-all; 透明背景 <IFRAME src="1.htm" width=300 height=180 allowtransparency></iframe> 获得style内容 obj.style.cssText HTML标签 document.documentElement.innerHTML 第一个style标签 document.styleSheets[0] style标签里的第一个样式 document.styleSheets[0].rules[0] 防止点击链接,页面往往重置到页首端。 <a href="javascript:function()">word</a> 上一网页源 asp: request.servervariables("HTTP_REFERER") javascript: document.referrer 释放内存 CollectGarbage(); 禁止右键 document.oncontextmenu = function() { return false;} 禁止保存 <noscript><iframe src="*.htm"></iframe></noscript> 禁止选取<body oncontextmenu="return false" ondragstart="return false" onselectstart ="return false" onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false"onmouseup="document.selection.empty()> 禁止粘贴 <input type=text onpaste="return false"> 地址栏图标 <link rel="Shortcut Icon" href="favicon.ico"> favicon.ico 名字最好不变16*16的16色,放虚拟目录根目录下 收藏栏图标 <link rel="Bookmark" href="favicon.ico"> 查看源码 <input type=button value=查看网页源代码 onclick="window.location = "view-source:"+ "http://www.csdn.net/""> 关闭输入法 <input style="ime-mode:disabled"> 自动全选 <input type=text name=text1 value="123" onfocus="this.select()"> ENTER键可以让光标移到下一个输入框 <input onkeydown="if(event.keyCode==13)event.keyCode=9"> 文本框的默认值 <input type=text value="123" onfocus="alert(this.defaultValue)"> title换行 obj.title = "123&#13sdfs&#32" 获得间所代表的微秒 var n1 = new Date("2004-10-10".replace(/-/g, "/")).getTime() 窗口是否关闭 win.closed checkbox扁平 <input type=checkbox style="position: absolute; clip:rect(5px 15px 15px 5px)"><br> 获取选内容 document.selection.createRange().duplicate().text 自动完成功能 <input type=text autocomplete=on>打开该功能 <input type=text autocomplete=off>关闭该功能 窗口最大化 <body onload="window.resizeTo(window.screen.width - 4,window.screen.height-50);window.moveTo(-4,-4)"> 无关闭按钮IE window.open("aa.htm", "meizz", "fullscreen=7"); 统一编码/解码 alert(decodeURIComponent(encodeURIComponent("http://你好.com?as= hehe"))) encodeURIComponent对":"、"/"、";" 和 "?"也编码 表格行指示 <tr onmouseover="this.bgColor="#f0f0f0"" onmouseout="this.bgColor="#ffffff""> //各种尺寸 s += " 网页可见区域宽:"+ document.body.clientWidth; s += " 网页可见区域高:"+ document.body.clientHeight; s += " 网页可见区域高:"+ document.body.offsetWeight +" (包括边线的宽)"; s += " 网页可见区域高:"+ document.body.offsetHeight +" (包括边线的宽)"; s += " 网页正文全文宽:"+ document.body.scrollWidth; s += " 网页正文全文高:"+ document.body.scrollHeight; s += " 网页被卷去的高:"+ document.body.scrollTop; s += " 网页被卷去的左:"+ document.body.scrollLeft; s += " 网页正文部分上:"+ window.screenTop; s += " 网页正文部分左:"+ window.screenLeft; s += " 屏幕分辨率的高:"+ window.screen.height; s += " 屏幕分辨率的宽:"+ window.screen.width; s += " 屏幕可用工作区高度:"+ window.screen.availHeight; s += " 屏幕可用工作区宽度:"+ window.screen.availWidth; //过滤数字 <input type=text onkeypress="return event.keyCode>=48&&event.keyCode<=57||(this.value.indexOf(".")<0?event.keyCode==46:false)" onpaste="return !clipboardData.getData("text").match(/D/)" ondragenter="return false"> //特殊用途 <input type=button value=导入收藏夹 onclick="window.external.ImportExportFavorites(true,"http://localhost");"> <input type=button value=导出收藏夹 onclick="window.external.ImportExportFavorites(false,"http://localhost");"> <input type=button value=整理收藏夹 onclick="window.external.ShowBrowserUI("OrganizeFavorites", null)"> <input type=button value=语言设置 onclick="window.external.ShowBrowserUI("LanguageDialog", null)"> <input type=button value=加入收藏夹 onclick="window.external.AddFavorite("http://www.google.com/", "google")"> <input type=button value=加入到频道 onclick="window.external.addChannel("http://www.google.com/")"> <input type=button value=加入到频道 onclick="window.external.showBrowserUI("PrivacySettings",null)"> //不缓存 <META HTTP-EQUIV="pragma" CONTENT="no-cache"> <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate"> <META HTTP-EQUIV="expires" CONTENT="0"> //正则匹配匹配文字符的正则表达式: [u4e00-u9fa5] 匹配双字节字符(包括汉字在内):[^x00-xff] 匹配行的正则表达式: [s| ]* 匹配HTML标记的正则表达式:/<(.*)>.*</1>|<(.*) />/ 匹配首尾格的正则表达式:(^s*)|(s*$)(像vbscript那样的trim函数) 匹配Email地址的正则表达式:w+([-+.]w+)*@w+([-.]w+)*.w+([-.]w+)* 匹配网址URL的正则表达式:http://([w-]+.)+[w-]+(/[w- ./?%&=]*)? 以下是例子: 利用正则表达式限制网页表单里的文本框输入内容: 用正则表达式限制只能输入文:onkeyup="value=value.replace(/[^u4E00-u9FA5]/g,"")" onbeforepaste="clipboardData.setData("text",clipboardData.getData("text").replace(/[^u4E00-u9FA5]/g,""))" 1.用正则表达式限制只能输入全角字符: onkeyup="value=value.replace(/[^uFF00-uFFFF]/g,"")" onbeforepaste="clipboardData.setData("text",clipboardData.getData("text").replace(/[^uFF00-uFFFF]/g,""))" 2.用正则表达式限制只能输入数字:onkeyup="value=value.replace(/[^d]/g,"") "onbeforepaste="clipboardData.setData("text",clipboardData.getData("text").replace(/[^d]/g,""))" 3.用正则表达式限制只能输入数字和英文:onkeyup="value=value.replace(/[W]/g,"") "onbeforepaste="clipboardData.setData("text",clipboardData.getData("text").replace(/[^d]/g,""))" //消除图像工具栏 <IMG SRC="mypicture.jpg" HEIGHT="100px" WIDTH="100px" GALLERYIMG="false"> or <head> <meta http-equiv="imagetoolbar" content="no"> </head> //无提示关闭 function Close() { var ua=navigator.userAgent var ie=navigator.appName=="Microsoft Internet Explorer"?true:false if(ie) { var IEversion=parseFloat(ua.substring(ua.indexOf("MSIE ")+5,ua.indexOf(";",ua.indexOf("MSIE ")))) if(IEversion< 5.5) { var str = "<object id=noTipClose classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">" str += "<param name="Command" value="Close"></object>"; document.body.insertAdjacentHTML("beforeEnd", str); document.all.noTipClose.Click(); } else { window.opener =null; window.close(); } } else { window.close() } } //取得控件得绝对位置(1) <script language="javascript"> function getoffset(e) { var t=e.offsetTop; var l=e.offsetLeft; while(e=e.offsetParent) { t+=e.offsetTop; l+=e.offsetLeft; } var rec = new Array(1); rec[0] = t; rec[1] = l; return rec } </script> //获得控件的绝对位置(2) oRect = obj.getBoundingClientRect(); oRect.left oRect. //最小化,最大化,关闭 <object id=min classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"> <param name="Command" value="Minimize"></object> <object id=max classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"> <param name="Command" value="Maximize"></object> <OBJECT id=close classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"> <PARAM NAME="Command" value="Close"></OBJECT> <input type=button value=最小化 onclick=min.Click()> <input type=button value=最大化 onclick=max.Click()> <input type=button value=关闭 onclick=close.Click()> //光标停在文字最后 <script language="javascript"> function cc() { var e = event.srcElement; var r =e.createTextRange(); r.moveStart("character",e.value.length); r.collapse(true); r.select(); } </script> <input type=text name=text1 value="123" onfocus="cc()"> //页面进入和退出的特效 进入页面<meta http-equiv="Page-Enter" content="revealTrans(duration=x, transition=y)"> 推出页面<meta http-equiv="Page-Exit" content="revealTrans(duration=x, transition=y)"> 这个是页面被载入和调出的一些特效。duration表示特效的持续间,以秒为单位。transition表示使 用哪种特效,取值为1-23:   0 矩形缩小   1 矩形扩大   2 圆形缩小   3 圆形扩大   4 下到上刷新   5 上到下刷新   6 左到右刷新   7 右到左刷新   8 竖百叶窗   9 横百叶窗   10 错位横百叶窗   11 错位竖百叶窗   12 点扩散   13 左右到间刷新   14 间到左右刷新   15 间到上下   16 上下到间   17 右下到左上   18 右上到左下   19 左上到右下   20 左下到右上   21 横条   22 竖条   23 //网页是否被检索 <meta name="ROBOTS" content="属性值">   其属性值有以下一些:   属性值为"all": 文件将被检索,且页上链接可被查询;   属性值为"none": 文件不被检索,而且不查询页上的链接;   属性值为"index": 文件将被检索;   属性值为"follow": 查询页上的链接;   属性值为"noindex": 文件不检索,但可被查询链接;   属性值为"nofollow": //打印分页 <p style="page-break-after:always">page1</p> <p style="page-break-after:always">page2</p> //设置打印 <object id="factory" style="display:none" viewastext classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" codebase="http://www.meadroid.com/scriptx/ScriptX.cab#Version=5,60,0,360" ></object> <input type=button value=页面设置 onclick="factory.printing.PageSetup()"> <input type=button value=打印预览 onclick="factory.printing.Preview()"> <script language=javascript> function window.onload() { // -- advanced features factory.printing.SetMarginMeasure(2) // measure margins in inches factory.printing.SetPageRange(false, 1, 3) // need pages from 1 to 3 factory.printing.printer = "HP DeskJet 870C" factory.printing.copies = 2 factory.printing.collate = true factory.printing.paperSize = "A4" factory.printing.paperSource = "Manual feed" // -- basic features factory.printing.header = "居左显示&b居显示&b居右显示页码,第&p页/共&P页" factory.printing.footer = "(自定义页脚)" factory.printing.portrait = false factory.printing.leftMargin = 0.75 factory.printing.topMargin = 1.5 factory.printing.rightMargin = 0.75 factory.printing.bottomMargin = 1.5 } function Print(frame) { factory.printing.Print(true, frame) // print with prompt } </script> <input type=button value="打印本页" onclick="factory.printing.Print(false)"> <input type=button value="页面设置" onclick="factory.printing.PageSetup()"> <input type=button value="打印预览" onclick="factory.printing.Preview()"><br> <a href="http://www.meadroid.com/scriptx/docs/printdoc.htm?static" target=_blank>具体使用手册,更多信息,点这里</a> //自带的打印预览 WebBrowser.ExecWB(1,1) 打开 Web.ExecWB(2,1) 关闭现在所有的IE窗口,并打开一个新窗口 Web.ExecWB(4,1) 保存网页 Web.ExecWB(6,1) 打印 Web.ExecWB(7,1) 打印预览 Web.ExecWB(8,1) 打印页面设置 Web.ExecWB(10,1) 查看页面属性 Web.ExecWB(15,1) 好像是撤销,有待确认 Web.ExecWB(17,1) 全选 Web.ExecWB(22,1) 刷新 Web.ExecWB(45,1) 关闭窗体无提示 <style media=print> .Noprint{display:none;}<!--用本样式在打印隐藏非打印项目--> .PageNext{page-break-after: always;}<!--控制分页--> </style> <object id="WebBrowser" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"> </object> <center class="Noprint" > <input type=button value=打印 onclick=document.all.WebBrowser.ExecWB(6,1)> <input type=button value=直接打印 onclick=document.all.WebBrowser.ExecWB(6,6)> <input type=button value=页面设置 onclick=document.all.WebBrowser.ExecWB(8,1)> </p> <p> <input type=button value=打印预览 onclick=document.all.WebBrowser.ExecWB(7,1)> </center> //去掉打印的页眉页脚 <script language="JavaScript"> var HKEY_Root,HKEY_Path,HKEY_Key; HKEY_Root="HKEY_CURRENT_USER"; HKEY_Path="\Software\Microsoft\Internet Explorer\PageSetup\"; //设置网页打印的页眉页脚为 function PageSetup_Null() { try { var Wsh=new ActiveXObject("WScript.Shell"); HKEY_Key="header"; Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,""); HKEY_Key="footer"; Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,""); } catch(e){} } //设置网页打印的页眉页脚为默认值 function PageSetup_Default() { try { var Wsh=new ActiveXObject("WScript.Shell"); HKEY_Key="header"; Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"&w&b页码,&p/&P"); HKEY_Key="footer"; Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"&u&b&d"); } catch(e){} } </script> <input type="button" value="清页码" onclick=PageSetup_Null()> <input type="button" value="恢复页码" onclick=PageSetup_Default()> //浏览器验证 function checkBrowser() { this.ver=navigator.appVersion this.dom=document.getElementById?1:0 this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0; this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0; this.ie4=(document.all && !this.dom)?1:0; this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; this.ns4=(document.layers && !this.dom)?1:0; this.mac=(this.ver.indexOf("Mac") > -1) ?1:0; this.ope=(navigator.userAgent.indexOf("Opera")>-1); this.ie=(this.ie6 || this.ie5 || this.ie4) this.ns=(this.ns4 || this.ns5) this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns5 || this.ns4 || this.mac || this.ope) this.nbw=(!this.bw) return this; } //计算内容宽和高 <SCRIPT language="javascript"> function test(obj) { var range = obj.createTextRange(); alert("内容区宽度: " + range.boundingWidth + "px 内容区高度: " + range.boundingHeight + "px"); } </SCRIPT> <BODY> <Textarea id="txt" height="150">sdf</textarea><INPUT type="button" value="计算内容宽度" onClick="test(txt)"> </BODY> //无模式的提示框 function modelessAlert(Msg) { window.showModelessDialog("javascript:alert(""+escape(Msg)+"");window.close();","","status:no;resizable:no;help:no;dialogHeight:height:30px;dialogHeight:40px;"); } //屏蔽按键 <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <noscript><meta http-equiv="refresh" content="0;url=about:noscript"></noscript> <title>屏蔽鼠标右键、Ctrl+N、Shift+F10、Alt+F4、F11、F5刷新、退格键</title> </head> <body> <script language="Javascript"><!-- //屏蔽鼠标右键、Ctrl+N、Shift+F10、F11、F5刷新、退格键 //Author: meizz(梅花雨) 2002-6-18 function document.oncontextmenu(){event.returnValue=false;}//屏蔽鼠标右键 function window.onhelp(){return false} //屏蔽F1帮助 function document.onkeydown() { if ((window.event.altKey)&& ((window.event.keyCode==37)|| //屏蔽 Alt+ 方向键 ← (window.event.keyCode==39))) //屏蔽 Alt+ 方向键 → { alert("不准你使用ALT+方向键前进或后退网页!"); event.returnValue=false; } /* 注:这还不是真正地屏蔽 Alt+ 方向键, 因为 Alt+ 方向键弹出警告框,按住 Alt 键不放, 用鼠标点掉警告框,这种屏蔽方法就失效了。以后若 有哪位高手有真正屏蔽 Alt 键的方法,请告知。*/ if ((event.keyCode==8) || //屏蔽退格删除键 (event.keyCode==116)|| //屏蔽 F5 刷新键 (event.ctrlKey && event.keyCode==82)){ //Ctrl + R event.keyCode=0; event.returnValue=false; } if (event.keyCode==122){event.keyCode=0;event.returnValue=false;} //屏蔽F11 if (event.ctrlKey && event.keyCode==78) event.returnValue=false; //屏蔽 Ctrl+n if (event.shiftKey && event.keyCode==121)event.returnValue=false; //屏蔽 shift+F10 if (window.event.srcElement.tagName == "A" && window.event.shiftKey) window.event.returnValue = false; //屏蔽 shift 加鼠标左键新开一网页 if ((window.event.altKey)&&(window.event.keyCode==115)) //屏蔽Alt+F4 { window.showModelessDialog("about:blank","","dialogWidth:1px;dialogheight:1px"); return false; } } </script> 屏蔽鼠标右键、Ctrl+N、Shift+F10、Alt+F4、F11、F5刷新、退格键 </body> </html> //屏蔽打印 <style> @media print{ * {display:none} } </style> //移动的图层,拖动 1.<span style="position:absolute;width:200;height:200;background:red" onmousedown=MouseDown(this) onmousemove=MouseMove() onmouseup=MouseUp()>meizz</span> <script language=javascript> var Obj; function MouseDown(obj) { Obj=obj; Obj.setCapture(); Obj.l=event.x-Obj.style.pixelLeft; Obj.t=event.y-Obj.style.pixelTop; } function MouseMove() { if(Obj!=null) { Obj.style.left = event.x-Obj.l; Obj.style.top = event.y-Obj.t; } } function MouseUp() { if(Obj!=null) { Obj.releaseCapture(); Obj=null; } } </script> 2. <div id="myDiv" src="logo.gif" ondrag="doDrag();" onmouseover="this.style.cursor="hand"" style="position:absolute;left=100;top=100;" onmousedown="doMouseDown();"> <a href="#" onclick="return false"><h1>wlecome</h1></a> </div> <script language="JavaScript" type="text/javascript"> var orgMouseX; var orgMouseY; var orgObjX; var orgObjY; function doDrag() { var myObject=document.all.myDiv; var x=event.clientX; var y=event.clientY; myObject.style.left=x-(orgMouseX-orgObjX); myObject.style.top=y-(orgMouseY-orgObjY); } function doMouseDown() { orgMouseX=event.clientX; orgMouseY=event.clientY; orgObjX=parseInt(document.all.myDiv.style.left); orgObjY=parseInt(document.all.myDiv.style.top); } </script> //文档状态改变 <iframe src="a.html" id="f" name="f" scrolling="no" frameborder=0 marginwidth=0 marginheight=0></iframe> <script> var doc=window.frames["f"].document; function s(){ if (doc.readyState=="complete"){ document.all.f.style.height=doc.body.scrollHeight document.all.f.style.width=doc.body.scrollWidth } } doc.onreadystatechange=s </script> //刷新后不变的文本框 <HTML> <HEAD> <META NAME="save" CONTENT="history"> <STYLE> .sHistory {behavior:url(#default#savehistory);} </STYLE> </HEAD> <BODY> <INPUT class=sHistory type=text id=oPersistInput> </BODY> </HTML> //访问剪贴板 (1)拖拽访问 event.dataTransfer.setData("URL", oImage.src); sImageURL = event.dataTransfer.getData("URL") (2)普通访问 window.clipboardData.setData("Text",oSource.innerText); window.clipboardData.getData("Text"); //操作COOKIE function SetCookie(sName, sValue) { document.cookie = sName + "=" + escape(sValue) + "; "; } function GetCookie(sName) { var aCookie = document.cookie.split("; "); for (var i=0; i < aCookie.length; i++) { var aCrumb = aCookie[i].split("="); if (sName == aCrumb[0]) return unescape(aCrumb[1]); } } function DelCookie(sName) { document.cookie = sName + "=" + escape(sValue) + "; expires=Fri, 31 Dec 1999 23:59:59 GMT;"; } //setTimeout增加参数 <script> var _st = window.setTimeout; window.setTimeout = function(fRef, mDelay) { if(typeof fRef == "function"){ var argu = Array.prototype.slice.call(arguments,2); var f = (function(){ fRef.apply(null, argu); }); return _st(f, mDelay); } return _st(fRef,mDelay); } function test(x){ alert(x); } window.setTimeout(test,1000,"fason"); </script> //自定义的apply,call Function.prototype.apply = function (obj, argu) { if (obj) obj.constructor.prototype._caller = this; var argus = new Array(); for (var i=0;i<argu.length;i++) argus[i] = "argu[" + i + "]"; var r; eval("r = " + (obj ? ("obj._caller(" + argus.join(",") + ");") : ("this(" + argus.join(",") + ");"))); return r; }; Function.prototype.call = function (obj) { var argu = new Array(); for (var i=1;i<arguments.length;i++) argu[i-1] = arguments[i]; return this.apply(obj, argu); }; //下载文件 function DownURL(strRemoteURL,strLocalURL) { try { var xmlHTTP=new ActiveXObject("Microsoft.XMLHTTP"); xmlHTTP.open("Get",strRemoteURL,false); xmlHTTP.send(); var adodbStream=new ActiveXObject("ADODB.Stream"); adodbStream.Type=1;//1=adTypeBinary adodbStream.Open(); adodbStream.write(xmlHTTP.responseBody); adodbStream.SaveToFile(strLocalURL,2); adodbStream.Close(); adodbStream=null; xmlHTTP=null; } catch(e) { window.confirm("下载URL出错!"); } //window.confirm("下载完成."); } //检验连接是否有效 function getXML(URL) { var xmlhttp = new ActiveXObject("microsoft.xmlhttp"); xmlhttp.Open("GET",URL, false); try { xmlhttp.Send(); } catch(e){} finally { var result = xmlhttp.responseText; if(result) { if(xmlhttp.Status==200) { return(true); } else { return(false); } } else { return(false); } } } //POST代替FORM <SCRIPT language="VBScript"> Function URLEncoding(vstrIn) strReturn = "" For i = 1 To Len(vstrIn) ThisChr = Mid(vStrIn,i,1) If Abs(Asc(ThisChr)) < &HFF Then strReturn = strReturn & ThisChr Else innerCode = Asc(ThisChr) If innerCode < 0 Then innerCode = innerCode + &H10000 End If Hight8 = (innerCode And &HFF00) &HFF Low8 = innerCode And &HFF strReturn = strReturn & "%" & Hex(Hight8) & "%" & Hex(Low8) End If Next URLEncoding = strReturn End Function Function bytes2BSTR(vIn) strReturn = "" For i = 1 To LenB(vIn) ThisCharCode = AscB(MidB(vIn,i,1)) If ThisCharCode < &H80 Then strReturn = strReturn & Chr(ThisCharCode) Else NextCharCode = AscB(MidB(vIn,i+1,1)) strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode)) i = i + 1 End If Next bytes2BSTR = strReturn End Function dim strA,oReq strA = URLEncoding("submit1=Submit&text1=文") set oReq = CreateObject("MSXML2.XMLHTTP") oReq.open "POST","http://ServerName/VDir/TstResult.asp",false oReq.setRequestHeader "Content-Length",Len(strA) oReq.setRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded" oReq.send strA msgbox bytes2BSTR(oReq.responseBody) </SCRIPT> //readyState是xmlhttp返回数据的进度,0=载入,1=未初始化,2=已载入,3=运行,4=完成 //组件是否安装 isComponentInstalled("{6B053A4B-A7EC-4D3D-4567-B8FF8A1A5739}", "componentID")) //检查网页是否存在 function CheckURL(URL) { var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); xmlhttp.Open("GET",URL, false); try { xmlhttp.Send(); var result = xmlhttp.status; } catch(e) {return(false); } if(result==200) { return true; } xmlhttp = null; return false; } //连接数据库 <script language="javascript"> //用 JavaScript 写服务器端连接数据库的代码示例 var conn = new ActiveXObject("ADODB.Connection"); conn.Open("Provider=SQLOLEDB.1; Data Source=localhost; User ID=sa; " +"Password=; Initial Catalog=pubs"); var rs = new ActiveXObject("ADODB.Recordset"); var sql="select * from authors"; rs.open(sql, conn); shtml = "<table width="100%" border=1>"; shtml +="<tr bgcolor="#f4f4f4"><td>au_id</td><td>au_lname</td><td>au_fname</td><td>phone</td><td>address</td><td> city</td><td>state</td><td>zip</td></tr>"; while(!rs.EOF) { shtml += "<tr><td>" + rs("au_id") + "</td><td>" + rs("au_lname") + "</td><td>" + rs("au_fname") + "</td><td>" + rs("phone") + "</td><td>" + rs("address") + "</td><td>" + rs("city") + "</td><td>" + rs("state") + "</td><td>" + rs("zip") + "</td></tr>"; rs.moveNext; } shtml += "</table>"; document.write(shtml); rs.close(); rs = null; conn.close(); conn = null; </script> //使用数据岛 <html> <body> srno:<input type=text datasrc=#xmldate DataFLD=srno size="76"><BR> times:<input type=text datasrc=#xmldate DataFLD=times size="76"><BR> <input id="first" TYPE=button value="<< 第一条记录" onclick="xmldate.recordset.moveFirst()"> <input id="prev" TYPE=button value="<上一条记录" onclick="xmldate.recordset.movePrevious()"> <input id="next" TYPE=button value="下一条记录>" onclick="xmldate.recordset.moveNext()"> <input id="last" TYPE=button value="最后一条记录>>" onclick="xmldate.recordset.moveLast()"> <input id="Add" TYPE=button value="添加新记录" onclick="xmldate.recordset.addNew()"> <XML ID="xmldate"> <infolist> <info ><srno>20041025-01</srno><times>null</times></info> <info ><srno>20041101-09</srno><times>2004年10月1日2点22分0秒</times></info> </infolist> </XML> </body> </html> //获得参数 <body> <a href="javascript:location.href=location.href + "?a=1&b=2"">search</a> <script language="JavaScript"> <!-- var a = location.search.substr(1); if(a.length>0) { var re = /([^&]*?)=([^&]*)/g var s = a.match(re); for(var i= 0;i<s.length;i++) { alert(s[i]); alert(s[i].split("=")[1]); } } //--> </script> </body> //可编辑SELECT <input type=text name=re_name style="width:100px;height:21px;font-size:10pt;"><span style="width:18px;border:0px solid red;"><select name="r00" style="margin-left:-100px;width:118px; background-color:#FFEEEE;" onChange="document.all.re_name.value=this.value;"> <option value="1">11111111<option> <option value="2">222222</option> <option value="3">333333</option> </select> </span> //设置光标位置 function getCaret(textbox) { var control = document.activeElement; textbox.focus(); var rang = document.selection.createRange(); rang.setEndPoint("StartToStart",textbox.createTextRange()) control.focus(); return rang.text.length; } function setCaret(textbox,pos) { try { var r =textbox.createTextRange(); r.moveStart("character",pos); r.collapse(true); r.select(); } catch(e) {} } function selectLength(textbox,start,len) { try { var r =textbox.createTextRange(); r.moveEnd("character",len-(textbox.value.length-start)); r.moveStart("character",start); r.select(); } catch(e) {//alert(e.description)} } function insertAtCaret(textbox,text) { textbox.focus(); document.selection.createRange().text = text; } //页内查找 function findInPage(str) { var txt, i, found,n = 0; if (str == "") { return false; } txt = document.body.createTextRange(); for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) { txt.moveStart("character", 1); txt.moveEnd("textedit"); } if (found) { txt.moveStart("character", -1); txt.findText(str); txt.select(); txt.scrollIntoView(); n++; } else { if (n > 0) { n = 0; findInPage(str); } else { alert(str + "... 您要找的文字不存在。 请试着输入页面的关键字再次查找!"); } } return false; } //书 http://www.itpub.net/attachment.php?s=&postid=1894598 http://www.wrclub.net/down/listdown.aspx?id=1341//操作EXECL <script language="javascript"> function jStartExcel() { var xls = new ActiveXObject ( "Excel.Application" ); xls.visible = true; var newBook = xls.Workbooks.Add; newBook.Worksheets.Add; newBook.Worksheets(1).Activate; xls.ActiveWorkBook.ActiveSheet.PageSetup.Orientation = 2; xls.ActiveWorkBook.ActiveSheet.PageSetup.PaperSize = 5; newBook.Worksheets(1).Columns("A").columnwidth=50; newBook.Worksheets(1).Columns("A").WrapText = true; newBook.Worksheets(1).Columns("B").columnwidth=50; newBook.Worksheets(1).Columns("B").WrapText = true; newBook.Worksheets(1).Range("A1:B1000").NumberFormat = "0"; newBook.Worksheets(1).Range("A1:B1000").HorizontalAlignment = -4131; newBook.Worksheets(1).Cells(1,1).Interior.ColorIndex="15"; newBook.Worksheets(1).Cells(1,1).value="First Column, First Cell"; newBook.Worksheets(1).Cells(2,1).value="First Column, Second Cell"; newBook.Worksheets(1).Cells(1,2).value="Second Column, First Cell"; newBook.Worksheets(1).Cells(2,2).value="Second Column, Second Cell"; newBook.Worksheets(1).Name="My First WorkSheet"; } </script> //自定义提示条 <a href="#" title="这是提示">tip</a> <script Language="JavaScript"> //***********默认设置定义.********************* tPopWait=50;//停留tWait豪秒后显示提示。 tPopShow=5000;//显示tShow豪秒后关闭提示 showPopStep=20; popOpacity=99; //***************内部变量定义***************** sPop=null; curShow=null; tFadeOut=null; tFadeIn=null; tFadeWaiting=null; document.write("<style type="text/css"id="defaultPopStyle">"); document.write(".cPopText { background-color: #F8F8F5;color:#000000; border: 1px #000000 solid;font-color: font-size: 12px; padding-right: 4px; padding-left: 4px; height: 20px; padding-top: 2px; padding-bottom: 2px; filter: Alpha(Opacity=0)}"); document.write("</style>"); document.write("<div id="dypopLayer" style="position:absolute;z-index:1000;" class="cPopText"></div>"); function showPopupText(){ var o=event.srcElement; MouseX=event.x; MouseY=event.y; if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""}; if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""}; if(o.dypop!=sPop) { sPop=o.dypop; clearTimeout(curShow); clearTimeout(tFadeOut); clearTimeout(tFadeIn); clearTimeout(tFadeWaiting); if(sPop==null || sPop=="") { dypopLayer.innerHTML=""; dypopLayer.style.filter="Alpha()"; dypopLayer.filters.Alpha.opacity=0; } else { if(o.dyclass!=null) popStyle=o.dyclass else popStyle="cPopText"; curShow=setTimeout("showIt()",tPopWait); } } } function showIt(){ dypopLayer.className=popStyle; dypopLayer.innerHTML=sPop; popWidth=dypopLayer.clientWidth; popHeight=dypopLayer.clientHeight; if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24 else popLeftAdjust=0; if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24 else popTopAdjust=0; dypopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust; dypopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust; dypopLayer.style.filter="Alpha(Opacity=0)"; fadeOut(); } function fadeOut(){ if(dypopLayer.filters.Alpha.opacity<popOpacity) { dypopLayer.filters.Alpha.opacity+=showPopStep; tFadeOut=setTimeout("fadeOut()",1); } else { dypopLayer.filters.Alpha.opacity=popOpacity; tFadeWaiting=setTimeout("fadeIn()",tPopShow); } } function fadeIn(){ if(dypopLayer.filters.Alpha.opacity>0) { dypopLayer.filters.Alpha.opacity-=1; tFadeIn=setTimeout("fadeIn()",1); } } document.onmouseover=showPopupText; </script> //插入文字 document.onclick =function(){ var oSource = window.event.srcElement; if(oSource.tagName!="DIV") return false; var sel = document.selection; if (sel!=null) { var rng = sel.createRange(); if (rng!=null) rng.pasteHTML("<font color=red>插入文字</font>"); } } //netscapte下操作xml doc = new ActiveXObject("Msxml2.DOMDocument"); doc = new ActiveXObject("Microsoft.XMLDOM") ->> doc = (new DOMParser()).parseFromString(sXML,"text/xml") //判断键值 <html> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <head> <script language="javascript"> var ie =navigator.appName=="Microsoft Internet Explorer"?true:false; function keyDown(e) { if(!ie) { var nkey=e.which; var iekey="现在是ns浏览器"; var realkey=String.fromCharCode(e.which); } if(ie) { var iekey=event.keyCode; var nkey="现在是ie浏览器"; var realkey=String.fromCharCode(event.keyCode); if(event.keyCode==32){realkey="" 格""} if(event.keyCode==13){realkey="" 回车""} if(event.keyCode==27){realkey="" Esc""} if(event.keyCode==16){realkey="" Shift""} if(event.keyCode==17){realkey="" Ctrl""} if(event.keyCode==18){realkey="" Alt""} } alert("ns浏览器键值:"+nkey+" "+"ie浏览器键值:"+iekey+" "+"实际键为"+realkey); } document.onkeydown = keyDown; </script> </head> <body> //Javascript Document. <hr> <center> <h3>请按任意一个键。。。。</h3> </center> </body> </html> //禁止FSO 1.注销组件 regsvr32 /u scrrun.dll 2.修改PROGID HKEY_CLASSES_ROOTScripting.FileSystemObject Scripting.FileSystemObject 3.对于使用object的用户,修改HKEY_CLASSES_ROOTScripting. //省略号 <DIV STYLE="width: 120px; height: 50px; border: 1px solid blue; overflow: hidden; text-overflow:ellipsis"> <NOBR>就是比如有一行文字,很长,表格内一行显示不下.</NOBR> </DIV> //检测media play版本 <IE:clientCaps ID="oClientCaps" style="{behavior:url(#default#clientcaps)}" /> <SCRIPT> var flash=""; WMPVersion= oClientCaps.getComponentVersion("{22D6F312-B0F6-11D0-94AB-0080C74C7E95}","ComponentID"); if (WMPVersion != "") { flash = ""; var version = WMPVersion.split(","); var i; for (i = 0; i < version.length; i++) { if (i != 0) flash += "."; flash += version[i]; } document.write("您的Windows Media Player 版本是:"+flash+"<p>"); } </SCRIPT> //图象按比例 <script language="JavaScript"> <!-- //图片按比例缩放 var flag=false; function DrawImage(ImgD){ var image=new Image(); var iwidth = 80; //定义允许图片宽度 var iheight = 80; //定义允许图片高度 image.src=ImgD.src; if(image.width>0 && image.height>0){ flag=true; if(image.width/image.height>= iwidth/iheight){ if(image.width>iwidth){ ImgD.width=iwidth; ImgD.height=(image.height*iwidth)/image.width; }else{ ImgD.width=image.width; ImgD.height=image.height; } ImgD.alt=image.width+"×"+image.height; } else{ if(image.height>iheight){ ImgD.height=iheight; ImgD.width=(image.width*iheight)/image.height; }else{ ImgD.width=image.width; ImgD.height=image.height; } ImgD.alt=image.width+"×"+image.height; } } } //--> </script> <img src=".." onload = "DrawImage(this)"> //细线SELECT function getComputerName() { var objWMIService = GetObject("Winmgmts:rootcimv2"); for(e = new Enumerator(objWMIService) ; !e.atEnd() ; e.moveNext()) { var getComputer = e.item(); return getComputer.Name; } } //条件编译 <script language=javascript> /*@cc_on @*/ /*@if (@_win32 && @_jscript_version>5) function window.confirm(str) { execScript("n = msgbox(""+ str +"", 257)", "vbscript"); return(n == 1); } @end @*/ </script> //取得innerText <SCRIPT LANGUAGE="JavaScript"> <!-- var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0"); var currNode; xmlDoc.async = false; xmlDoc.async = false; xmlDoc.loadXML("<TABLENAME> 你好你阿三 大法 司法等四 </TABLENAME>"); currNode = xmlDoc.documentElement; var s = currNode.xml; var r = /<([^>s]*?)[^>]*?>([^<]*?)</1>/ var b = s.replace(r,"$2"); alert(b); //--> </SCRIPT> //mergeAttributes 复制所有读/写标签属性到指定元素。 <SCRIPT> function fnMerge(){ oSource.children[1].mergeAttributes(oSource.children[0]); } </SCRIPT> <SPAN ID=oSource> <DIV ID="oDiv" ATTRIBUTE1="true" ATTRIBUTE2="true" onclick="alert("click");" onmouseover="this.style.color="#0000FF";" onmouseout="this.style.color="#000000";" > This is a sample <B>DIV</B> element. </DIV> <DIV ID="oDiv2"> This is another sample <B>DIV</B> element. </DIV> </SPAN> <INPUT TYPE="button" VALUE="Merge Attributes" onclick="fnMerge()" > 以上内容可以随意转载,转载后请注名来源和出处! 原文链接:http://ttyp.cnblogs.com/archive/2004/11/15/63900.aspx <span style="border:1px solid #000000; position:absolute; overflow:hidden;" > <select style="margin:-2px;"> <option>1111</option> <option>11111111111111</option> <option>111111111</option> </select></span> //Import function Import() { for( var i=0; i<arguments.length; i++ ) { var file = arguments[i]; if ( file.match(/.js$/i)) document.write("<script type="text/javascript" src="" + file + ""></sc" + "ript>"); else document.write("<style type="text/css">@import "" + file + "" ;</style>"); } }; //js枚举 function getComputerName() { var objWMIService = GetObject("Winmgmts:rootcimv2"); for(e = new Enumerator(objWMIService) ; !e.atEnd() ; e.moveNext()) { var getComputer = e.item(); return getComputer.Name; } } //条件编译 <script language=javascript> /*@cc_on @*/ /*@if (@_win32 && @_jscript_version>5) function window.confirm(str) { execScript("n = msgbox(""+ str +"", 257)", "vbscript"); return(n == 1); } @end @*/ </script> //取得innerText <SCRIPT LANGUAGE="JavaScript"> <!-- var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0"); var currNode; xmlDoc.async = false; xmlDoc.async = false; xmlDoc.loadXML("<TABLENAME> 你好你阿三 大法 司法等四 </TABLENAME>"); currNode = xmlDoc.documentElement; var s = currNode.xml; var r = /<([^>s]*?)[^>]*?>([^<]*?)</1>/ var b = s.replace(r,"$2"); alert(b); //--> </SCRIPT> //mergeAttributes 复制所有读/写标签属性到指定元素。 <SCRIPT> function fnMerge(){ oSource.children[1].mergeAttributes(oSource.children[0]); } </SCRIPT> <SPAN ID=oSource> <DIV ID="oDiv" ATTRIBUTE1="true" ATTRIBUTE2="true" onclick="alert("click");" onmouseover="this.style.color="#0000FF";" onmouseout="this.style.color="#000000";" > This is a sample <B>DIV</B> element. </DIV> <DIV ID="oDiv2"> This is another sample <B>DIV</B> element. </DIV> </SPAN> <INPUT TYPE="button" VALUE="Merge Attributes" onclick="fnMerge()" > 电子书制作:源码爱好者
EhLib 8.0 Build 8.0.023 Pro Edition FullSource for D7-XE8 亲测可用,含全部源码及 Demo The Library contains components and classes for Borland Delphi versions 7, 9, Developer Studio 2006, Delphi 2007, Embarcadero RAD Studio 2009-XE8, Lazarus. TABLE OF CONTENTS ----------------- Overview Installation Library Installation Help Demonstration Programs Registering and Prices Other information About author Where to start. ------------------- Read about EhLib for Lazarus in the file - Lazarus\readme.txt Start overview of the library with the main Demo project .\Demos\Bin\MainDemo.Exe. (Compiled Demo files are available in the Evaluation version of the library) Then you can read a summary of the new features and changes in the file history-eng.html. More detail about new features can be found in the file - About EhLib 8 Eng.doc To install a new version of the library in the IDE, use the installation program in .\Installer\EhLibInstaller.exe Overview -------- The Library contains several components and objects. TDBGridEh component TDBGridEh provides all functionality of TDBGrid and adds several new features as follows: Allows to select records, columns and rectangle areas. Special titles that can correspond to several/all columns. Footer that is able to show sum/count/other field values. Automatic column resizing to set grid width equal client width. Ability to change row and title height. Allows automatic broken of a single line long title and data row to a multiline. Title can act as button and, optionally show a sort marker. Automatically sortmarking. Ability to truncate long text with ellipsis. Lookup list can show several fields. Incremental search in lookup fields. Frozen columns. DateTime picker support for TDateField and TDateTimeField. Allows to show bitmaps from TImageList depending on field value. Allows to hide and track horizontal or vertical scrollbars. Allows to hide columns. Allows to show 3D fr
Git-2.21.0-64 for windows Git 2.23 Release Notes ====================== Updates since v2.22 ------------------- Backward compatibility note * The "--base" option of "format-patch" computed the patch-ids for prerequisite patches in an unstable way, which has been updated to compute in a way that is compatible with "git patch-id --stable". * The "git log" command by default behaves as if the --mailmap option was given. UI, Workflows & Features * The "git fast-export/import" pair has been taught to handle commits with log messages in encoding other than UTF-8 better. * In recent versions of Git, per-worktree refs are exposed in refs/worktrees/<wtname>/ hierarchy, which means that worktree names must be a valid refname component. The code now sanitizes the names given to worktrees, to make sure these refs are well-formed. * "git merge" learned "--quit" option that cleans up the in-progress merge while leaving the working tree and the index still in a mess. * "git format-patch" learns a configuration to set the default for its --notes=<ref> option. * The code to show args with potential typo that cannot be interpreted as a commit-ish has been improved. * "git clone --recurse-submodules" learned to set up the submodules to ignore commit object names recorded in the superproject gitlink and instead use the commits that happen to be at the tip of the remote-tracking branches from the get-go, by passing the new "--remote-submodules" option. * The pattern "git diff/grep" use to extract funcname and words boundary for Matlab has been extend to cover Octave, which is more or less equivalent. * "git help git" was hard to discover (well, at least for some people). * The pattern "git diff/grep" use to extract funcname and words boundary for Rust has been added. * "git status" can be told a non-standard default value for the "--[no-]ahead-behind" option with a new configuration variable status.aheadBehind. * "git fetch" and "git pull" reports when a fetch results in non-fast-forward updates to let the user notice unusual situation. The commands learned "--no-show-forced-updates" option to disable this safety feature. * Two new commands "git switch" and "git restore" are introduced to split "checking out a branch to work on advancing its history" and "checking out paths out of the index and/or a tree-ish to work on advancing the current history" out of the single "git checkout" command. * "git branch --list" learned to always output the detached HEAD as the first item (when the HEAD is detached, of course), regardless of the locale. * The conditional inclusion mechanism learned to base the choice on the branch the HEAD currently is on. * "git rev-list --objects" learned the "--no-object-names" option to squelch the path to the object that is used as a grouping hint for pack-objects. * A new tag.gpgSign configuration variable turns "git tag -a" into "git tag -s". * "git multi-pack-index" learned expire and repack subcommands. * "git blame" learned to "ignore" commits in the history, whose effects (as well as their presence) get ignored. * "git cherry-pick/revert" learned a new "--skip" action. * The tips of refs from the alternate object store can be used as starting point for reachability computation now. * Extra blank lines in "git status" output have been reduced. * The commits in a repository can be described by multiple commit-graph files now, which allows the commit-graph files to be updated incrementally. * "git range-diff" output has been tweaked for easier identification of which part of what file the patch shown is about. Performance, Internal Implementation, Development Support etc. * Update supporting parts of "git rebase" to remove code that should no longer be used. * Developer support to emulate unsatisfied prerequisites in tests to ensure that the remainder of the tests still succeeds when tests with prerequisites are skipped. * "git update-server-info" learned not to rewrite the file with the same contents. * The way of specifying the path to find dynamic libraries at runtime has been simplified. The old default to pass -R/path/to/dir has been replaced with the new default to pass -Wl,-rpath,/path/to/dir, which is the more recent GCC uses. Those who need to build with an old GCC can still use "CC_LD_DYNPATH=-R" * Prepare use of reachability index in topological walker that works on a range (A..B). * A new tutorial targeting specifically aspiring git-core developers has been added. * Auto-detect how to tell HP-UX aCC where to use dynamically linked libraries from at runtime. * "git mergetool" and its tests now spawn fewer subprocesses. * Dev support update to help tracing out tests. * Support to build with MSVC has been updated. * "git fetch" that grabs from a group of remotes learned to run the auto-gc only once at the very end. * A handful of Windows build patches have been upstreamed. * The code to read state files used by the sequencer machinery for "git status" has been made more robust against a corrupt or stale state files. * "git for-each-ref" with multiple patterns have been optimized. * The tree-walk API learned to pass an in-core repository instance throughout more codepaths. * When one step in multi step cherry-pick or revert is reset or committed, the command line prompt script failed to notice the current status, which has been improved. * Many GIT_TEST_* environment variables control various aspects of how our tests are run, but a few followed "non-empty is true, empty or unset is false" while others followed the usual "there are a few ways to spell true, like yes, on, etc., and also ways to spell false, like no, off, etc." convention. * Adjust the dir-iterator API and apply it to the local clone optimization codepath. * We have been trying out a few language features outside c89; the coding guidelines document did not talk about them and instead had a blanket ban against them. * A test helper has been introduced to optimize preparation of test repositories with many simple commits, and a handful of test scripts have been updated to use it. Fixes since v2.22 ----------------- * A relative pathname given to "git init --template=<path> <repo>" ought to be relative to the directory "git init" gets invoked in, but it instead was made relative to the repository, which has been corrected. * "git worktree add" used to fail when another worktree connected to the same repository was corrupt, which has been corrected. * The ownership rule for the file descriptor to fast-import remote backend was mixed up, leading to an unrelated file descriptor getting closed, which has been fixed. * A "merge -c" instruction during "git rebase --rebase-merges" should give the user a chance to edit the log message, even when there is otherwise no need to create a new merge and replace the existing one (i.e. fast-forward instead), but did not. Which has been corrected. * Code cleanup and futureproof. * More parameter validation. * "git update-server-info" used to leave stale packfiles in its output, which has been corrected. * The server side support for "git fetch" used to show incorrect value for the HEAD symbolic ref when the namespace feature is in use, which has been corrected. * "git am -i --resolved" segfaulted after trying to see a commit as if it were a tree, which has been corrected. * "git bundle verify" needs to see if prerequisite objects exist in the receiving repository, but the command did not check if we are in a repository upfront, which has been corrected. * "git merge --squash" is designed to update the working tree and the index without creating the commit, and this cannot be countermanded by adding the "--commit" option; the command now refuses to work when both options are given. * The data collected by fsmonitor was not properly written back to the on-disk index file, breaking t7519 tests occasionally, which has been corrected. * Update to Unicode 12.1 width table. * The command line to invoke a "git cat-file" command from inside "git p4" was not properly quoted to protect a caret and running a broken command on Windows, which has been corrected. * "git request-pull" learned to warn when the ref we ask them to pull from in the local repository and in the published repository are different. * When creating a partial clone, the object filtering criteria is recorded for the origin of the clone, but this incorrectly used a hardcoded name "origin" to name that remote; it has been corrected to honor the "--origin <name>" option. * "git fetch" into a lazy clone forgot to fetch base objects that are necessary to complete delta in a thin packfile, which has been corrected. * The filter_data used in the list-objects-filter (which manages a lazily sparse clone repository) did not use the dynamic array API correctly---'nr' is supposed to point at one past the last element of the array in use. This has been corrected. * The description about slashes in gitignore patterns (used to indicate things like "anchored to this level only" and "only matches directories") has been revamped. * The URL decoding code has been updated to avoid going past the end of the string while parsing %-<hex>-<hex> sequence. * The list of for-each like macros used by clang-format has been updated. * "git branch --list" learned to show branches that are checked out in other worktrees connected to the same repository prefixed with '+', similar to the way the currently checked out branch is shown with '*' in front. (merge 6e9381469e nb/branch-show-other-worktrees-head later to maint). * Code restructuring during 2.20 period broke fetching tags via "import" based transports. * The commit-graph file is now part of the "files that the runtime may keep open file descriptors on, all of which would need to be closed when done with the object store", and the file descriptor to an existing commit-graph file now is closed before "gc" finalizes a new instance to replace it. * "git checkout -p" needs to selectively apply a patch in reverse, which did not work well. * Code clean-up to avoid signed integer wraparounds during binary search. * "git interpret-trailers" always treated '#' as the comment character, regardless of core.commentChar setting, which has been corrected. * "git stash show 23" used to work, but no more after getting rewritten in C; this regression has been corrected. * "git rebase --abort" used to leave refs/rewritten/ when concluding "git rebase -r", which has been corrected. * An incorrect list of options was cached after command line completion failed (e.g. trying to complete a command that requires a repository outside one), which has been corrected. * The code to parse scaled numbers out of configuration files has been made more robust and also easier to follow. * The codepath to compute delta islands used to spew progress output without giving the callers any way to squelch it, which has been fixed. * Protocol capabilities that go over wire should never be translated, but it was incorrectly marked for translation, which has been corrected. The output of protocol capabilities for debugging has been tweaked a bit. * Use "Erase in Line" CSI sequence that is already used in the editor support to clear cruft in the progress output. * "git submodule foreach" did not protect command line options passed to the command to be run in each submodule correctly, when the "--recursive" option was in use. * The configuration variable rebase.rescheduleFailedExec should be effective only while running an interactive rebase and should not affect anything when running a non-interactive one, which was not the case. This has been corrected. * The "git clone" documentation refers to command line options in its description in the short form; they have been replaced with long forms to make them more recognisable. * Generation of pack bitmaps are now disabled when .keep files exist, as these are mutually exclusive features. (merge 7328482253 ew/repack-with-bitmaps-by-default later to maint). * "git rm" to resolve a conflicted path leaked an internal message "needs merge" before actually removing the path, which was confusing. This has been corrected. * "git stash --keep-index" did not work correctly on paths that have been removed, which has been fixed. (merge b932f6a5e8 tg/stash-keep-index-with-removed-paths later to maint). * Window 7 update ;-) * A codepath that reads from GPG for signed object verification read past the end of allocated buffer, which has been fixed. * "git clean" silently skipped a path when it cannot lstat() it; now it gives a warning. * "git push --atomic" that goes over the transport-helper (namely, the smart http transport) failed to prevent refs to be pushed when it can locally tell that one of the ref update will fail without having to consult the other end, which has been corrected. * The internal diff machinery can be made to read out of bounds while looking for --function-context line in a corner case, which has been corrected. (merge b777f3fd61 jk/xdiff-clamp-funcname-context-index later to maint). * Other code cleanup, docfix, build fix, etc. (merge fbec05c210 cc/test-oidmap later to maint). (merge 7a06fb038c jk/no-system-includes-in-dot-c later to maint). (merge 81ed2b405c cb/xdiff-no-system-includes-in-dot-c later to maint). (merge d61e6ce1dd sg/fsck-config-in-doc later to maint).
Jquery是继prototype之后又一个优秀的Javascrīpt框架。它是轻量级的js库(压缩后只有21k) ,它兼容CSS3,还兼容各种浏览器 (IE 6.0+, FF 1.5+, Safari 2.0+, Opera 9.0+)。jQuery使用户能更方便地处理HTML documents、events、实现动画效果,并且方便地为网站提供AJAX交互。jQuery还有一个比较大的优势是,它的文档说明很全,而且各种应用也说得很详细,同还有许多成熟的插件可供选择。jQuery能够使用户的html页保持代码和html内容分离,也就是说,不用再在html里面插入一堆js来调用命令了,只需定义id即可。 目录 简介 找到你了! Jquery对象 代替body标签的onload 事件机制 同一函数实现get\set ajax 渐入淡出 plugin 历史版本 1、新的事件.on() .off() 3、动画的改进 1.42版介绍 JQuery插件 让Dreamweaver支持提示代码功能 引入JQuery简介 找到你了! Jquery对象 代替body标签的onload 事件机制 同一函数实现get\set ajax 渐入淡出 plugin历史版本1、新的事件.on() .off()3、动画的改进1.42版介绍JQuery插件让Dreamweaver支持提示代码功能引入JQuery展开编辑本段简介   jQuery由美国人John Resig创建,至今已吸引了来自世界各地的众多javascript高手加入其team,包括来自德国的Jörn Zaefferer,罗马尼亚的Stefan Petre等等。jQuery是继prototype之后又一个优秀的Javascrīpt框架。其宗旨是——WRITE LESS,DO MORE,写更少的代码,做更多的事情。   由于目前高校基本尚未开JavaScript的相关课程,目前jQuery的学习,使用,研究都仅限于在职Web程序员之间。   用jq的前提,首先要引用一个有jq的文件   [removed][removed]   这个是jquery官方最新的地址。可用在自己网站里加个这个,就能使用jquery了。 但仍然建议下载到本地服务器上。 编辑本段找到你了!   在编写js库代码候,你一定经常和“$”美元符号打交道吧?无论prototype还是DWR都使用了$代替频繁的document.getElementById()操作。jQuery也这样做了,但是,它的功能远非如此,瞧瞧以下的jQuery代码,你就会发现它的美丽:   代码   var someElement = $("#myId");   看起来比其他两个框架的要多了一个#,好,看看下面的用法:   代码   $("div p"); // (1)   $("div.container"); // (2)   $("div #msg"); // (3)   $("table a",context); // (4)   在prototype里看过这样的写法吗?第一行代码得到所有div标签下的p元素。第二行代码得到class 为container的div元素,第三行代码得到标签下面id为msg的div元素(不过最好别这样写,因为jQuery需要遍历所有的div元素,对于带id的元素,直接用$("#id"))。第四行代码得到context为上下文的table里面所有的链接元素。   如果你熟悉CSS,你会觉得这些写法很眼熟!对了。正是。看出奥妙了吧。jQuery就是如此强大,你可以轻易地找到DOM的任何元素,而这也是jQuery设计之初query的真实含义(查询)。 编辑本段Jquery对象   jquery提供了很多便利的函数,如each(fn),但是使用这些函数的前提是:你使用的对象是Jquery对象。使一个Dom对象成为一个Jquery对象很简单,通过下面一些方式(只是一部分):   代码   var a = $("#cid");   var b = $("<p>hello</p>");   var c = document.createElement("table");   var tb = $(c); 编辑本段代替body标签的onload   这个惯例,也许是除了$()之外,用得最多的地方了。下面一段代码:   代码   $(document).ready(function(){   alert("hello");   });(1)   <body>(2)   <body>这里的alert('hello');要等到页面全部加载完毕才执行,注意是全部加载,包括dom,图片等其它资源。   而$(document).ready(function(){   alert("hello");   });(1)   当dom加载完就可以执行了。   代码1同做到表现和逻辑分离。并且可以在不同的js文件做相同的操作,即$(document).ready (fn)可以在一个页面重复出现,而不会冲突。基本上Jquery的很多plugin都是利用这个特性,正因为这个特性,多个plugin共同使用起来,在初始化不会发生冲突。   当使用jquery,推荐使用代码1。 编辑本段事件机制   我们大量使用的事件可能就是button的onclick了。以前习惯在input 元素上写onclick = "fn()",使用jquery可以使javascrīpt代码与html代码分离,保持HTML的清洁,还可以很轻松地绑定事件,甚至你可以不知道“事件”这个名词。   代码   $(document).ready(function()   {   $("#clear").click(function(){   alert("i am about to clear the table");   });   $("form[12]").submit(validate);   });   function validate(){   //do some form validation   } 编辑本段同一函数实现get\set   代码   $("selector").load(url,data,function(response,status,xhr))   该方法是最简单的从服务器获取数据的方法。它几乎与 $.get(url, data, success) 等价,不同的是它不是全局函数,并且它拥有隐式的回调函数。当侦测到成功的响应(比如,当 textStatus 为 "success" 或 "notmodified" ),.load() 将匹配元素的 HTML 内容设置为返回数据。这意味着该方法的大多数使用会非常简单。 编辑本段ajax   这是一个ajax横行的代。多少人,了不了解ajax的都跟着用上一把。呵。使用jquery实现ajax同样异常简单   代码   (1)   $.get("search. do",{id:1},rend);   function rend(xml){   alert(xml);   }   (2)   $.post("search. do",{id:1},rend);   function rend(xml){   alert(xml);   }   (3)   $("#msg").ajaxStart(function(){   this.html("正在加载。。。。");   });   (4)   $("#msg").ajaxSuccess(function(){   this.html("加载完成!");   });   这些都是较常用的方法,get和post用法一样。第一个参数是异步请求的url,第二个为参数,第三个回调方法。   (4)的方法会在指定的Dom对象上绑定响应ajax执行的事件。   (5)同步加载数据。发送请求锁住浏览器。需要锁定用户交互操作使用同步方式。   var html = $.ajax({   url: "some.php",   async: false   }).responseText;   (6) 保存数据到服务器,成功显示信息。   $.ajax({   type: "POST",   url: "some.php",   data: "name=John&location=Boston",   success: function(msg){   alert( "Data Saved: " + msg );   }   }); 编辑本段渐入淡出   代码   $("#msg").show("fast");   $("#msg").hide("slow");   $("#msg").fadeIn();   $("#msg").fadeOut();   没错,上面两行代码已经分别实现了一个id为Msg的jquery对象的渐入和淡出。做一个像Gmail一样的动态加载通知条,用jquery就那么简单。两个函数接受的参数除了快慢等,还可以接收整型,作为渐入或淡出的完成间,单位为MS。 编辑本段plugin   这也是一个插件的代。   jquery插件给我的感觉清一色的清洁,简单。如Jtip,要使用它的功能,只需要在你的元素的class上加上Jtip,并引入jtip.js及其样式即可以了。其他事情插件全包。我喜欢jquery的一个重要原因是发现她已经有了很多很好,很精彩的插件。   写得很烂。可能大家看不出jquery的好处。嗯,光听是没用的,试用一下吧。你会发觉很有趣。   暂告一段落吧。待有新的发现再来分享。   加一些Jquery的资源:   http://www.visualjquery. com/index.xml 很好的API查询站点   http://jquery. com/demo/thickbox/ 知道lightBox吧,看看Jquery是怎样实现相同的东西   http://jquery. org. cn/visual/cn/index.xml //不错的JQUERY 文学习 推荐   微软的visual studio 2008 sp1支持对jquery的动态提示,只要在代码页导入对应的vsdoc脚本就可以。   目前为止,jQuery的最新版本为1.7.2。 编辑本段历史版本   jQuery 1.0(2006年8月):该库的第一个稳定版本,已经具有了对CSS选择符、事件处理和AJAX交互的稳健支持。   jQuery 1.1(2007年1月):这一版大幅简化了API。许多较少使用的方法被合并,减少了需要掌握和解释的方法数量。   jQuery 1.1.3(2007年7月):这次小版本变化包含了对jQuery选择符引擎执行速度的显著提升。从这个版本开始,jQuery的性能达到了Prototype、Mootools以及Dojo等同类JavaScript库的水平。   jQuery 1.2(2007年9月):这一版去掉了对XPath选择符的支持,原因是相对于CSS语法它已经变得多余了。这一版能够支持对效果的更灵活定制,而且借助新增的命名间事件,也使插件开发变得更容易。   jQuery UI(2007年9月):这个新的插件套件是作为曾经流行但已过的Interface插件的替代项目而发布的。jQuery UI包含大量预定义好的部件(widget),以及一组用于构建高级元素(例如可拖放的界面元素)的工具。   jQuery 1.2.6(2008年5月):这一版主要是将Brandon Aaron开发的流行的Dimensions插件的功能移植到了核心库。   jQuery 1.3(2009年1月):这一版使用了全新的选择符引擎Sizzle,库的性能也因此有了极大提升。这一版正式支持事件委托特性。   jQuery 1.3.2(2009年2月):这次小版本升级进一步提升了库的性能,例如改进了:visible/:hidden选择符、.height()/.width()方法的底层处理机制。另外,也支持查询的元素按文档顺序返回。   jQuery 1.4(2010年1月14号对)代码库进行了内部重写组织,开始建立一些风格规范。老的core.js文件被分为attribute.js, css.js, data.js, manipulation.js, traversing.js和queue.js;CSS和attribute的逻辑分离。   jQuery 1.5(2011年1月31日):该版本修复了83个bug,解决了460个问题。重大改进有:重写了Ajax模块;新增延缓对像(Deferred Objects);jQuery替身——jQuery.sub();增强了遍历相邻节点的性能;jQuery开发团队构建系统的改进。   1.4重要新特性:   ·常用方法的性能大幅提升:重写了大部分较早期的函数;   ·更容易使用的设置函数(setter function):为所有对象新增了许多易用的设置函数;   ·对Ajax的改进:引入了许多Ajax和JSON处理方面的更新,包括HTML5元素的序列化;   ·attribute(改进了.attr()的性能)、jQuery()核心函数、CSS(.css()性能有两倍提升)、特效和事件、DOM操作等也有显著改进   1.5   美国间1月31日John Resig在jQuery官方博客发表文章,宣布jQuery 1.5正式版已经如期开发完成,可以下载使用。压缩版本jQuery Minified29KB,不压缩版本jQuery Regular(用于阅读和调试)207KB。由于jQuery已经成为目前最流行的JavaScript库,得到广泛的支持,新版本的发布当然非常引人注目。   重要变化:   1. Ajax重写Ajax模块完全进行了重写。新增一个jXHR对象,为不同浏览器内置的XMLHttpRequest提供了一致的超集。对于XMLHttpRequest之外的传输机制,比如JSONP请求,jXHR对象也可以进行处理。(详情可以参见:jQuery.ajax文档)   此外,系统的可扩展性大大增强,可以附加各种数据处理器、过滤器和传输机制,为开发新的Ajax插件提供了方便。   2. 延迟对象   延迟对象(Deferred Object,jQuery.Deferred对象)是一个可链接的(chainable)实用工具对象,实现了Promise接口,可以在回调队列注册多个回调、调用回调队列并转发任何同步/异步函数的成败状态。正如Using Deferreds in jQuery 1.5一文说明的,其结果是在jQuery能够将依赖于某个任务(事件)结果的逻辑与任务本身解耦了。这一点在JavaScript其实并不新鲜,Mochikit和Dojo等已经实现有些日子了。由于jQuery 1.5的Ajax模块内置使用了延迟对象,因此现在通过jQuery编写Ajax程序将自动获得这一功能。   开发人员借此可以使用无法立即获得的返回值(如异步Ajax请求的返回结果),而且第一次能够附加多个事件处理器。   例如,使用了新的jQuery内部Ajax API就可以实现下面的代码了:   // Assign handlers immediately after making the request, // and remember the jxhr object for this request var jxhr = $.ajax({ url: "example.php" }) .success(function() { alert("success"); }) .error(function() { alert("error"); }) .complete(function() { alert("complete"); });// perform other work here ... // Set another completion function for the request above jxhr.complete(function(){ alert("second complete"); });   此外,使用jQuery.Deferred还可以开发自己的延迟对象。更多详情参见:延迟对象文档。   3. jQuery.sub()   jQuery 1.5提供了一种创建和修改jQuery副本的方式。可以用来添加不向外部公开的方法,或者对jQuery的某些方法进行重新定义以提供新功能,或者提供更好的封装、避免名称间冲突。当然,也可以用来开发插件,但Resig强烈建议在开发插件之前,先考虑jQuery UI widget工厂。   值得注意的是,sub函数并不提供真正的隔离,所有方法、数据、调用仍然依靠jQuery本身来支持。   4. 遍历性能提高   在新版本.children(), .pre(), .next()几个常用的遍历函数性能有了显著提高。   5. 内部开发系统   John Resig还特别提到了jQuery团队内部开发系统的两点改变:一是服务器端用Node.js替换了老的Java/Rhino系统,使得团队可以专注于JavaScript环境的新变化;二是所用的代码优化程序从Google Closure切换到UglifyJS,新工具的压缩效果非常令人满意。   有意思的是,此前UglifyJS开发者曾经公布过自己的测试结果,表明对jQuery的压缩结果UglifyJS要比Closure略大(都在72KB左右),但运行速度快得多,而且Closure不太安全。看来,这段间UglifyJS的进展也很快啊。   jQuery 1.5.2 在1.5的基础上修正的大量的bug   1,7b   2011年09月29日jQuery 1.7 的第一个 beta 测试版本,该版本修复了超过 50 个的问题以及带来一些新特性。   2011年11月-04日jQuery1.7正式版发布。    新版本包含了很多新的特征,特别提升了事件委派的性能尤其是在IE7下。   新增及改进项:   1. 新的事件 APIs: .on() and .off();   2. 提升了事件委派的性能有了大幅度的提升,尤其是在IE7下;   3. 更好的在 IE 6/7/8 上支持 HTML5;   4. 切换动画更加直观;   5. 匿名模块定义 AWD   6. jQuery.Deferred   7. jQuery.isNumeric()   被删除的方法:   event.layerX and event.layerY   jQuery.isNaN()   2012年03月24日jQuery 1.7.2正式版发布。    该版本在1.7.1的基础上修复了大量的bug,并改进了部分功能。而相比于1.7.2 RC1,只修复了一个bug。值得注意的是:如果你正在使用jQuery Mobile,请使用最新的jQuery 1.7.2和jQuery Mobile 1.1这两个版本,因为之前的jQuery Mobile版本还基于jQuery core 1.7.1或更早的版本。 编辑本段1、新的事件.on() .off()   旧的 API(jQuery 1.7之前) 新的 API(jQuery 1.7) $(elems).bind(events, fn) $(elems).on(events, fn) $(elems).bind(events, { mydata: 42 }, fn) $(elems).on(events, { mydata: 42 }, fn) $(elems).unbind(events, fn) $(elems).off(events, fn) $(elems).delegate(events, selector, fn) $(elems).on(events, selector, fn) $(elems).undelegate(events, selector, fn) $(elems).off(events, selector, fn) $(selector).live(events, fn) $(document).on(events, selector, fn) $(selector).die(events, fn) $(document).off(events, selector, fn) 编辑本段3、动画的改进   在jQuery 1.7版之前,如果你在完成前停止动画,它可以创建的情况下被动画的元素永远不会返回到其全尺寸,它基本上停留在高度,这是停止动画。 我们记住的原始尺寸固定,动画开始之前,让他们以后可以使用。 这消除了一大烦恼,尤其是在使用一定的动画切换的。 编辑本段1.42版介绍   jQuer1.4.2版本修复了1.4版本的一些错误和优化了一些不错的改进,速度比1.4.1版本又提升 了一倍,该版本对性能做了一些改进,同增加了一些api ( .delegate() and .undelegate(). ),右图是JQuery各个版本的性能比较:   jquery1.42新特性:   加了两个新方法:.delegate() 和.undelegate(). 是对.live() and .die() 的补充. 这两个方法对特定的事件的起到简化。   范例:   $("table").delegate("td", "hover", function(){ $(this).toggleClass("hover"); });   等于使用 .live():   $("table").each(function(){ $("td", this).live("hover", function(){ $(this).toggleClass("hover"); }); });   另外,以下代码,.live() 基本上等同于 .delegate().   $(document).delegate("td", "hover", function(){ $(this).toggleClass("hover"); });   变更   大量代码进行了重写, 提升了性能及修正了一些长期存在的问题。   提升性能   每次开发新的jquery版本,我们都努力去持续优化性能,以保证你能用到最高性能的javascript代码。   在Taskspeed benchmark 的测试,1.4.2比1.4.1快1倍,比1.3.2快2倍。   主要是在下面4个方面进行了提升:   .bind() 和 .unbind().   .empty(), .remove(), 和 .html().   插入单个DOM 节点到 document.   $("body")   在测试用例,比较多的用到了 $("body"), .bind(), .unbind()方法,因此测试结果提升比较明显。   v重写事件   event handlers 不再作为一个对象属性保存在 jQuery的内部对象里。现在是保存在一个内部的对象数组里。v 现在可以通过调用.data("events") , 将会返回一个对象包含的所有事件类型。   现在可以使用不同的数据、命名间、事件类型绑定在同一个handler   在一个handler清除自己之后,事件handler会继续执行   不用关联数据或者命名间到事件handler   不用再使用代理方法   事件执行的顺序在所有浏览器得到保证,Google Chrome 出现的对象循环逻辑问题已经得到解决. 编辑本段JQuery插件   【基础】   a)样式   很 多人会认为样式是个很复杂的东西,需要沉着冷静的心态加上非凡的审美观才能设计出赏心悦目的UI,抛开图片设计不说,其实css也就是那么些属 性:position,margin,padding,width,height,left,top,float,border,background&hellip;   UI设计的漂亮与否在很大程度上依赖于设计人员对配色的把握和整体效果的协调。   b)脚本   我们同样需要对javascript有着深刻的理解,对dom, xhr, Regex, call-apply, prototype等都应该有一定的了解。   有人会说要这些有啥用啊,对dom的操作其实通过getElementById, getElementsByTagName以及其他的API都可以轻松的完成,这话是没错,当思路确定后,思想才是重点,一段代码是精华还是糟粕很容易就 可以区分出来,究其原因还是取决你自己   【实践】   jQuery开发或使用,更多的灵感是来自实践,而不是copy||paste(奉行拿来主义的同学可以离开了)。   那么在这里我会用一个简单的例子来阐述jQuery插件开发的流程,能否举一反三就看各位看官了。   【目的】   开发一个插件之前我们需要对自己的目的有一个清醒的认识,有很明确的方向感,那么此次我作为示例插件的目的,就是呈现一个用于UI的Slider – 滑动条,常年从事于或暂专注于win32开发的同学应该比较了解。   【草图】   真正动手编码之前我们还需要有一个草图来描述自己插件的“长相”(事件驱动或API封装的可以忽略)。   很多的同学在做UI开发前往往会忙于搜集各种小图片(非精通ps或iconworkshop人士),其实漂亮的图标的确可以美化我们的UI,不过我一般的处理方式是编写易于扩展的css,前期的UI呈现尽量少使用图片,多用线条完成。   【编码】   开发jQuery UI/Effect 插件在很多候都需要与UI交互,因此在呈现上需要提供Html tree来绘制我们的插件,最终通过js dom来输出,那么在绘制简单的dom结构的候我会直接用js来完成,不过如果嵌套比较复杂的话,我们还是应该先用html来完成,然后转变成js输 出。   【扩展】   有的候用户却不是那么容易满足,于是有人高呼:“我要自己设置value,为什么不提供这个功能?”。   那么这我们就需要为用户公开一个方法,用于设置jSlider的value,首先考虑的是作为方法需要一个作用对象(jSlider),那么此我又不 想将作用对象作为参数传入,那么我们还是将这个方法作为插件来开发,我们将方法命名为setSliderValue,开放2个参数,v(value值)和 callback(设置完成后的回调函数)。   【插件】   其实网上已经有成百上千种插件了,应该可以满足大家的需求了。   【小结】   通篇到这里就结束了,简单的介绍了一款jQuery插件的开发流程,以及开发应该注意的细节,那么在下一篇的文章我会向大家介绍如何打造一个通用型的 自动完成 插件。 编辑本段让Dreamweaver支持提示代码功能   要让Dreamweaver支持jQuery自动提示代码功能,方法很简单,下载一个插件—jQuery_API.mxp,以及cs4的jQuery语法提示插件 (详细步骤见参考资料 [1])。 在Dreamweaver里依次选择“命令” -> “扩展管理” -> “安装扩展” -> &hellip;,就会自动安装了。   成功后重启Dreamweaver,就大功告成了。 编辑本段引入JQuery   在head标签内加入这个 [removed][removed]   这里的src是你的jQuery库文件的位置,可以到jquery官网下载。   这样就引入了jquery,就可以使用了。在代码,遇到$一般就表示用了jquery。为什么要说一般呢?因为除了jquery,javascript还有一个库,用的也是$符(property库)。   jquery也给出了在遇到这种情况的解决办法,所以jquery是个很强大、开放、友好的js库。   下面举例:   [removed]   $(document).ready(function(){   //write your code here   })   [removed]   上面代码$(document).ready(function()的$就是jquery的简写,可以用jquery代替。这个ready函数是在DOM就绪后发生,他比传统的javascript方法更合理。   jquery在选取节点方面非常强大,jquery有一系列的选择器可供使用,非常简洁、高效。   基本选择器(3种):   $("标签名"),如$("p")是选取了所有的p标签节点   $("#id名"),如$("#test")是选取了id为test的标签节点   $(".class名"),如$(".test")是选取了所有class为test的标签节点   上面的$("标签名")和$(".class名")返回的都是所有满足的节点,至于进一步筛选可以添加一些函数,如eq,gt,lt等等。    当然,jquery还有很多选择器

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值