随笔分类 -  javascript

document.getElementsByName 和 document.getElementsByTagName
摘要:当页面上的控件同名且多个的时候,从程序的严密角度出发,需要判断长度,而且有长度和没长度是两种引用方法. oEle= document.all.aaa ;//这里有一个aaa的对象,但我们不知道它现在长度是多少,所以没办法对它操作.因此,我们要先做判断长度的过程.如下: if(oEle.length){}else{}; 在两种情况下,花括号里面的内容写法也是不一样的: if(oEle.length)... 阅读全文
posted @ 2007-10-31 13:05 微星 阅读(11642) 评论(2) 推荐(0)
修改TreeView1.0的BUG
摘要:C:\Inetpub\wwwroot\webctrl_client\1_0文件夹下treeview.htc 查找el.checked = !el.checked; 修改为: el.checked = !el.getAttribute("checked"); 阅读全文
posted @ 2007-09-21 10:36 微星 阅读(208) 评论(0) 推荐(0)
Js:document.getElementsByTagName()集合应用范例
摘要: 阅读全文
posted @ 2007-07-18 18:03 微星 阅读(3251) 评论(0) 推荐(0)
onkeypress,onkeydown,onkeyup区别
摘要:onkeypress,onkeydown,onkeyup区别 onkeypress是在用户按下并放开任何字母数字键时发生。系统按钮(例如,箭头键和功能键)无法得到识别。 onkeyup 是在用户放开任何先前按下的键盘键时发生。 onkeydown 是在用户按下任何键盘键(包括系统按钮,如箭头键和功能键)时发生。 阅读全文
posted @ 2007-07-03 17:26 微星 阅读(619) 评论(0) 推荐(0)
用JS如何獲得DropDownList所選Text和Value?
摘要:Textdocument.getElementById("DropDownListClientID").options[document.getElementById("DropDownListClientID").selectedIndex].textValuedocument.getElementById("DropDownListClientID").value 阅读全文
posted @ 2007-04-03 10:11 微星 阅读(538) 评论(0) 推荐(0)
将金额小写转化成汉字大写(javascript)
摘要:function Arabia_to_Chinese(Num){ for(i=Num.length-1;i>=0;i--) { Num = Num.replace(",","")//替换tomoney()中的“,” Num = Num.replace(" ","")//替换tomoney()中的空格 } Num = Num.replace("¥","")//替换掉可能... 阅读全文
posted @ 2007-01-30 10:41 微星 阅读(327) 评论(0) 推荐(0)
Window.Open详解
摘要:Window.Open详解 一、window.open()支持环境:JavaScript1.0+/JScript1.0+/Nav2+/IE3+/Opera3+ 二、基本语法:window.open(pageURL,name,parameters) 其中:pageURL 为子窗口路径 name 为子窗口句柄 parameters 为窗口参数(各参数用逗号分隔) 三、示例: 脚本运行后,pag... 阅读全文
posted @ 2007-01-26 16:56 微星 阅读(3638) 评论(0) 推荐(0)
始终在屏幕中间弹出窗口
摘要:function OpenWindow(url,width,height,name,options){var left = (screen.width-width)/2;var top = (screen.height-height)/2;if(options ==null)options ="";var newWin = window.open(url,name,"left=" +left+"... 阅读全文
posted @ 2007-01-26 16:16 微星 阅读(1008) 评论(0) 推荐(0)
利用CSS样式轻松让IE打印分页
摘要:如何让网页在打印时自动分页,下面介绍最简单的利用CSS样式控制IE分页打印:首先定义分页样式:再需要分页的地方调用CSS样式,如下:第一页第二页第三页在IE里面打印欲览一下。注:JS调用IE打印命令:window.print(); page-break-after : auto | ... 阅读全文
posted @ 2007-01-25 13:09 微星 阅读(4971) 评论(1) 推荐(0)
用javascript设置IE的打印页边距
摘要: 阅读全文
posted @ 2007-01-22 13:18 微星 阅读(4330) 评论(1) 推荐(0)
使用ActiveX读取客户端mac地址
摘要://保存为html文件获取客户端MAC和用户名 阅读全文
posted @ 2007-01-13 10:48 微星 阅读(2663) 评论(6) 推荐(0)
javascript小技巧
摘要:javascript小技巧 loverty 发表于 2005-8-17 9:23:00 ... 阅读全文
posted @ 2007-01-04 13:29 微星 阅读(449) 评论(0) 推荐(0)