﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-飘着的叶子，什么时候才落地-随笔分类-html</title><link>http://www.cnitblog.com/piaoye12345/category/1035.html</link><description /><language>zh-cn</language><lastBuildDate>Thu, 29 Sep 2011 09:32:40 GMT</lastBuildDate><pubDate>Thu, 29 Sep 2011 09:32:40 GMT</pubDate><ttl>60</ttl><item><title>用javascript 實現頁面在加載的效果</title><link>http://www.cnitblog.com/piaoye12345/archive/2006/06/28/12965.html</link><dc:creator>萌芽的叶子</dc:creator><author>萌芽的叶子</author><pubDate>Wed, 28 Jun 2006 01:04:00 GMT</pubDate><guid>http://www.cnitblog.com/piaoye12345/archive/2006/06/28/12965.html</guid><wfw:comment>http://www.cnitblog.com/piaoye12345/comments/12965.html</wfw:comment><comments>http://www.cnitblog.com/piaoye12345/archive/2006/06/28/12965.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/piaoye12345/comments/commentRss/12965.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/piaoye12345/services/trackbacks/12965.html</trackback:ping><description><![CDATA[
		<a href="http://52cg.com/Training/web/JavaScript/200606/55144.html">http://52cg.com/Training/web/JavaScript/200606/55144.html</a>
<img src ="http://www.cnitblog.com/piaoye12345/aggbug/12965.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/piaoye12345/" target="_blank">萌芽的叶子</a> 2006-06-28 09:04 <a href="http://www.cnitblog.com/piaoye12345/archive/2006/06/28/12965.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>滚动代码2 </title><link>http://www.cnitblog.com/piaoye12345/archive/2006/01/18/6236.html</link><dc:creator>萌芽的叶子</dc:creator><author>萌芽的叶子</author><pubDate>Wed, 18 Jan 2006 04:00:00 GMT</pubDate><guid>http://www.cnitblog.com/piaoye12345/archive/2006/01/18/6236.html</guid><wfw:comment>http://www.cnitblog.com/piaoye12345/comments/6236.html</wfw:comment><comments>http://www.cnitblog.com/piaoye12345/archive/2006/01/18/6236.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/piaoye12345/comments/commentRss/6236.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/piaoye12345/services/trackbacks/6236.html</trackback:ping><description><![CDATA[<DIV class=postTitle>&nbsp;</DIV>
<P>&lt;style type="text/css"&gt;<BR>A.a02 {text-decoration:underline;color:#0B0096;font-size:14px;line-height:160%}<BR>A.a02.hover {text-decoration:none;color:#ff6600;font-size:14px;line-height:160%}<BR>&lt;/style&gt;<BR>&lt;script LANGUAGE='JavaScript'&gt;<BR>var totalRolling = 3;<BR>var strArray=new Array();<BR>strArray[0] = '&lt;a class="a02" href="<A href="http://s.cn/go.aspx"><FONT color=#6fbc4c>http://s.cn/go.aspx</FONT></A>" target="_blank"&gt;&lt;font color=red&gt;女生！&lt;/font&gt;&lt;/a&gt;';<BR>strArray[1] = '&lt;a class="a02" href="<A href="http://g.anyp.cn/"><FONT color=#6fbc4c>http://g.anyp.cn/</FONT></A>" target="_blank"&gt;&lt;font color=blue&gt;自助建群&lt;/font&gt;&lt;/a&gt;';<BR>strArray[2] = '&lt;a class="a02" href="<A href="http://www.a/"><FONT color=#6fbc4c>http://www.a</FONT></A>" target="_blank"&gt;&lt;font color=blue&gt;免费！&lt;/font&gt;&lt;/a&gt;';<BR>strArray[3] = '&lt;a class="a02" href="<A href="http://client.alexa.com/"><FONT color=#6fbc4c>http://client.alexa.com/</FONT></A>" target="_blank"&gt;&lt;font color=red&gt;下载并&lt;/a&gt;&lt;/a&gt;';<BR>strArray[4] = '&lt;a class="a02" href="<A href="http://www.anyp.cn/"><FONT color=#6fbc4c>http://www.anyp.cn</FONT></A>" target="_blank"&gt;&lt;font color=red&gt;博&lt;/a&gt;&lt;/a&gt;';</P>
<P>showId=Math.floor(Math.random()*totalRolling);<BR>tempStr=strArray[showId];<BR>strArray[showId]=strArray[0];<BR>strArray[0]=tempStr;<BR>&lt;/script&gt;<BR>&lt;script&gt;<BR>document.write('&lt;table width=100% border=0 cellspacing=0 cellpadding=0&gt;'<BR>+'&lt;tr&gt;&lt;td&gt;'<BR>+'&lt;div id="icefable1" style="width:460;"&gt;'<BR>+'&lt;table width=460 border=0 cellspacing=0 cellpadding=0&gt;');</P>
<P>for(i=0;i&lt;strArray.length;i++)<BR>{<BR>&nbsp;document.write('&lt;tr&gt;&lt;td&gt;&amp;nbsp;'+strArray[i]+'&lt;/td&gt;&lt;/tr&gt;');<BR>}<BR>document.write('&lt;/table&gt;'<BR>+'&lt;/div&gt;'<BR>+'&lt;/td&gt;&lt;/tr&gt;'<BR>+'&lt;/table&gt;');</P>
<P>marqueesHeight=23;<BR>stopscroll=false;<BR>icefable1.scrollTop=0;</P>
<P>with(icefable1){<BR>&nbsp; style.width=0;<BR>&nbsp; style.height=marqueesHeight;<BR>&nbsp; style.overflowX="visible";<BR>&nbsp; style.overflowY="hidden";<BR>&nbsp; noWrap=true;<BR>&nbsp; onmouseover=new Function("stopscroll=true");<BR>&nbsp; onmouseout=new Function("stopscroll=false");<BR>}</P>
<P>preTop=0; currentTop=marqueesHeight; stoptime=0;<BR>icefable1.innerHTML+=icefable1.innerHTML;</P>
<P>function init_srolltext(){<BR>&nbsp; icefable1.scrollTop=0;<BR>&nbsp; setInterval("scrollUp()",40);<BR>}init_srolltext();</P>
<P>function scrollUp(){<BR>&nbsp; if(stopscroll==true) return;<BR>&nbsp; currentTop+=1;<BR>&nbsp; if(currentTop==marqueesHeight+1)<BR>&nbsp; {<BR>&nbsp; &nbsp;stoptime+=1;<BR>&nbsp; &nbsp;currentTop-=1;<BR>&nbsp; &nbsp;if(stoptime==40) <BR>&nbsp; &nbsp;{<BR>&nbsp; &nbsp;&nbsp;currentTop=0;<BR>&nbsp; &nbsp;&nbsp;stoptime=0;<BR>&nbsp; &nbsp;}<BR>&nbsp; }<BR>&nbsp; else {&nbsp; &nbsp;<BR>&nbsp;&nbsp; preTop=icefable1.scrollTop;<BR>&nbsp;&nbsp; icefable1.scrollTop+=1;<BR>&nbsp;&nbsp; if(preTop==icefable1.scrollTop){<BR>&nbsp;&nbsp;&nbsp;&nbsp; icefable1.scrollTop=marqueesHeight*(totalRolling-1);<BR>&nbsp;&nbsp;&nbsp;&nbsp; icefable1.scrollTop+=1;<BR>&nbsp;&nbsp; }<BR>&nbsp; }</P>
<P>}</P>
<P>&lt;/script&gt;</P><img src ="http://www.cnitblog.com/piaoye12345/aggbug/6236.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/piaoye12345/" target="_blank">萌芽的叶子</a> 2006-01-18 12:00 <a href="http://www.cnitblog.com/piaoye12345/archive/2006/01/18/6236.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>40种网页常用小技巧(javascript) </title><link>http://www.cnitblog.com/piaoye12345/archive/2006/01/18/6234.html</link><dc:creator>萌芽的叶子</dc:creator><author>萌芽的叶子</author><pubDate>Wed, 18 Jan 2006 03:50:00 GMT</pubDate><guid>http://www.cnitblog.com/piaoye12345/archive/2006/01/18/6234.html</guid><wfw:comment>http://www.cnitblog.com/piaoye12345/comments/6234.html</wfw:comment><comments>http://www.cnitblog.com/piaoye12345/archive/2006/01/18/6234.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/piaoye12345/comments/commentRss/6234.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/piaoye12345/services/trackbacks/6234.html</trackback:ping><description><![CDATA[<DIV class=postTitle>&nbsp;</DIV>1. oncontextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标右键<BR>&lt;table border oncontextmenu=return(false)&gt;&lt;td&gt;no&lt;/table&gt; 可用于Table<BR><BR>2. &lt;body onselectstart="return false"&gt; 取消选取、防止复制<BR><BR>3. onpaste="return false" 不准粘贴<BR><BR>4. oncopy="return false;" oncut="return false;" 防止复制<BR><BR>5. &lt;link rel="Shortcut Icon" href="favicon.ico"&gt; IE地址栏前换成自己的图标<BR><BR>6. &lt;link rel="Bookmark" href="favicon.ico"&gt; 可以在收藏夹中显示出你的图标<BR><BR>7. &lt;input style="ime-mode:disabled"&gt; 关闭输入法<BR><BR>8. 永远都会带着框架<BR>&lt;script language="JavaScript"&gt;&lt;!--<BR>if (window == top)top.location.href = "frames.htm"; //frames.htm为框架网页<BR>// --&gt;&lt;/script&gt;<BR><BR>9. 防止被人frame<BR>&lt;SCRIPT LANGUAGE=JAVASCRIPT&gt;&lt;!-- <BR>if (top.location != self.location)top.location=self.location;<BR>// --&gt;&lt;/SCRIPT&gt;<BR><BR>10. 网页将不能被另存为<BR>&lt;noscript&gt;&lt;iframe src=*.html&gt;&lt;/iframe&gt;&lt;/noscript&gt; <BR><BR>11. &lt;input type=button value=查看网页源代码 <BR>onclick="window.location = "view-source:"+ "http://www.pconline.com.cn""&gt;<BR><BR>12.删除时确认<BR>&lt;a href="javascript:if(confirm("确实要删除吗?"))location="boos.asp?&amp;areyou=删除&amp;page=1""&gt;删除&lt;/a&gt; <BR><BR>13. 取得控件的绝对位置<BR>//Javascript<BR>&lt;script language="Javascript"&gt;<BR>function getIE(e){<BR>var t=e.offsetTop;<BR>var l=e.offsetLeft;<BR>while(e=e.offsetParent){<BR>t+=e.offsetTop;<BR>l+=e.offsetLeft;<BR>}<BR>alert("top="+t+"/nleft="+l);<BR>}<BR>&lt;/script&gt;<BR><BR>//VBScript<BR>&lt;script language="VBScript"&gt;&lt;!--<BR>function getIE()<BR>dim t,l,a,b<BR>set a=document.all.img1<BR>t=document.all.img1.offsetTop<BR>l=document.all.img1.offsetLeft<BR>while a.tagName&lt;&gt;"BODY"<BR>set a = a.offsetParent<BR>t=t+a.offsetTop<BR>l=l+a.offsetLeft<BR>wend<BR>msgbox "top="&amp;t&amp;chr(13)&amp;"left="&amp;l,64,"得到控件的位置"<BR>end function<BR>--&gt;&lt;/script&gt;<BR><BR>14. 光标是停在文本框文字的最后<BR>&lt;script language="javascript"&gt;<BR>function cc()<BR>{<BR>var e = event.srcElement;<BR>var r =e.createTextRange();<BR>r.moveStart("character",e.value.length);<BR>r.collapse(true);<BR>r.select();<BR>}<BR>&lt;/script&gt;<BR>&lt;input type=text name=text1 value="123" onfocus="cc()"&gt;<BR><BR>15. 判断上一页的来源<BR>javascript:<BR>document.referrer<BR><BR>16. 最小化、最大化、关闭窗口<BR>&lt;object id=hh1 classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"&gt; <BR>&lt;param name="Command" value="Minimize"&gt;&lt;/object&gt;<BR>&lt;object id=hh2 classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"&gt; <BR>&lt;param name="Command" value="Maximize"&gt;&lt;/object&gt;<BR>&lt;OBJECT id=hh3 classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"&gt;<BR>&lt;PARAM NAME="Command" VALUE="Close"&gt;&lt;/OBJECT&gt;<BR>&lt;input type=button value=最小化 onclick=hh1.Click()&gt;<BR>&lt;input type=button value=最大化 onclick=hh2.Click()&gt;<BR>&lt;input type=button value=关闭 onclick=hh3.Click()&gt;<BR>本例适用于IE<BR><BR>17.屏蔽功能键Shift,Alt,Ctrl<BR>&lt;script&gt;<BR>function look(){ <BR>if(event.shiftKey) <BR>alert("禁止按Shift键!"); //可以换成ALT　CTRL<BR>} <BR>document.onkeydown=look; <BR>&lt;/script&gt;<BR><BR>18. 网页不会被缓存<BR>&lt;META HTTP-EQUIV="pragma" CONTENT="no-cache"&gt;<BR>&lt;META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate"&gt;<BR>&lt;META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT"&gt;<BR>或者&lt;META HTTP-EQUIV="expires" CONTENT="0"&gt;<BR><BR>19.怎样让表单没有凹凸感？<BR>&lt;input type=text style="border:1 solid #000000"&gt; <BR>或<BR>&lt;input type=text style="border-left:none; border-right:none; border-top:none; border-bottom: <BR><BR>1 solid #000000"&gt;&lt;/textarea&gt;<BR><BR>20.&lt;div&gt;&lt;span&gt;&amp;&lt;layer&gt;的区别？ <BR>&lt;div&gt;(division)用来定义大段的页面元素，会产生转行 <BR>&lt;span&gt;用来定义同一行内的元素，跟&lt;div&gt;的唯一区别是不产生转行 <BR>&lt;layer&gt;是ns的标记，ie不支持，相当于&lt;div&gt;<BR><BR>21.让弹出窗口总是在最上面:<BR>&lt;body onblur="this.focus();"&gt;<BR><BR>22.不要滚动条? <BR>让竖条没有: <BR>&lt;body style="overflow:scroll;overflow-y:hidden"&gt; <BR>&lt;/body&gt; <BR>让横条没有: <BR>&lt;body style="overflow:scroll;overflow-x:hidden"&gt; <BR>&lt;/body&gt; <BR>两个都去掉？更简单了 <BR>&lt;body scroll="no"&gt; <BR>&lt;/body&gt; <BR><BR>23.怎样去掉图片链接点击后，图片周围的虚线？<BR>&lt;a href="#" onFocus="this.blur()"&gt;&lt;img src="logo.jpg" border=0&gt;&lt;/a&gt;<BR><BR>24.电子邮件处理提交表单<BR>&lt;form name="form1" method="post" action="mailto:****@***.com" enctype="text/plain"&gt; <BR>&lt;input type=submit&gt;<BR>&lt;/form&gt;<BR><BR>25.在打开的子窗口刷新父窗口的代码里如何写？<BR>window.opener.location.reload()<BR><BR>26.如何设定打开页面的大小<BR>&lt;body onload="top.resizeTo(300,200);"&gt;<BR>打开页面的位置&lt;body onload="top.moveBy(300,200);"&gt;<BR><BR>27.在页面中如何加入不是满铺的背景图片,拉动页面时背景图不动 <BR>&lt;STYLE&gt; <BR>body <BR>{background-image:url(logo.gif); background-repeat:no-repeat; <BR>background-position:center;background-attachment: fixed} <BR>&lt;/STYLE&gt; <BR><BR>28. 检查一段字符串是否全由数字组成<BR>&lt;script language="Javascript"&gt;&lt;!--<BR>function checkNum(str){return str.match(//D/)==null}<BR>alert(checkNum("1232142141"))<BR>alert(checkNum("123214214a1"))<BR>// --&gt;&lt;/script&gt;<BR><BR>29. 获得一个窗口的大小<BR>document.body.clientWidth; document.body.clientHeight<BR><BR>30. 怎么判断是否是字符<BR>if (/[^/x00-/xff]/g.test(s)) alert("含有汉字");<BR>else alert("全是字符");<BR><BR>31.TEXTAREA自适应文字行数的多少<BR>&lt;textarea rows=1 name=s1 cols=27 onpropertychange="this.style.posHeight=this.scrollHeight"&gt;<BR>&lt;/textarea&gt;<BR><BR>32. 日期减去天数等于第二个日期<BR>&lt;script language=Javascript&gt;<BR>function cc(dd,dadd)<BR>{<BR>//可以加上错误处理<BR>var a = new Date(dd)<BR>a = a.valueOf()<BR>a = a - dadd * 24 * 60 * 60 * 1000<BR>a = new Date(a)<BR>alert(a.getFullYear() + "年" + (a.getMonth() + 1) + "月" + a.getDate() + "日")<BR>}<BR>cc("12/23/2002",2)<BR>&lt;/script&gt;<BR><BR>33. 选择了哪一个Radio<BR>&lt;HTML&gt;&lt;script language="vbscript"&gt;<BR>function checkme()<BR>for each ob in radio1<BR>if ob.checked then window.alert ob.value<BR>next<BR>end function<BR>&lt;/script&gt;&lt;BODY&gt;<BR>&lt;INPUT name="radio1" type="radio" value="style" checked&gt;Style<BR>&lt;INPUT name="radio1" type="radio" value="barcode"&gt;Barcode<BR>&lt;INPUT type="button" value="check" onclick="checkme()"&gt;<BR>&lt;/BODY&gt;&lt;/HTML&gt;<BR><BR>34.脚本永不出错<BR>&lt;SCRIPT LANGUAGE="JavaScript"&gt; <BR>&lt;!-- Hide <BR>function killErrors() { <BR>return true; <BR>} <BR>window.onerror = killErrors; <BR>// --&gt; <BR>&lt;/SCRIPT&gt;<BR><BR>35.ENTER键可以让光标移到下一个输入框<BR>&lt;input onkeydown="if(event.keyCode==13)event.keyCode=9"&gt;<BR><BR>36. 检测某个网站的链接速度：<BR>把如下代码加入&lt;body&gt;区域中:<BR>&lt;script language=Javascript&gt;<BR>tim=1<BR>setInterval("tim++",100)<BR>b=1<BR>var autourl=new Array()<BR>autourl[1]="www.njcatv.net"<BR>autourl[2]="javacool.3322.net"<BR>autourl[3]="www.sina.com.cn"<BR>autourl[4]="www.nuaa.edu.cn"<BR>autourl[5]="www.cctv.com"<BR>function butt(){<BR>document.write("&lt;form name=autof&gt;")<BR>for(var i=1;i&lt;autourl.length;i++)<BR>document.write("&lt;input type=text name=txt"+i+" size=10 value=测试中……&gt; =》&lt;input type=text <BR>name=url"+i+" size=40&gt; =》&lt;input type=button value=GO <BR><BR>onclick=window.open(this.form.url"+i+".value)&gt;&lt;br&gt;")<BR>document.write("&lt;input type=submit value=刷新&gt;&lt;/form&gt;")<BR>}<BR>butt()<BR>function auto(url){<BR>document.forms[0]["url"+b].value=url<BR>if(tim&gt;200)<BR>{document.forms[0]["txt"+b].value="链接超时"}<BR>else<BR>{document.forms[0]["txt"+b].value="时间"+tim/10+"秒"}<BR>b++<BR>}<BR>function run(){for(var i=1;i&lt;autourl.length;i++)document.write("&lt;img src=http://"+autourl+"/"+Math.random()+" <BR><BR>width=1 height=1 <BR><BR>onerror=auto("http://"+autourl+"")&gt;")}<BR>run()&lt;/script&gt;<BR><BR>37. 各种样式的光标<BR>auto ：标准光标<BR>default ：标准箭头<BR>hand ：手形光标<BR>wait ：等待光标<BR>text ：I形光标<BR>vertical-text ：水平I形光标<BR>no-drop ：不可拖动光标<BR>not-allowed ：无效光标<BR>help ：?帮助光标<BR>all-scroll ：三角方向标<BR>move ：移动标<BR>crosshair ：十字标<BR>e-resize<BR>n-resize<BR>nw-resize<BR>w-resize<BR>s-resize<BR>se-resize<BR>sw-resize<BR><BR>38.页面进入和退出的特效<BR>进入页面&lt;meta http-equiv="Page-Enter" content="revealTrans(duration=x, transition=y)"&gt;<BR>推出页面&lt;meta http-equiv="Page-Exit" content="revealTrans(duration=x, transition=y)"&gt; <BR>这个是页面被载入和调出时的一些特效。duration表示特效的持续时间，以秒为单位。transition表示使用哪种特效，取值为<BR><BR>1-23:<BR>　　0 矩形缩小 <BR>　　1 矩形扩大 <BR>　　2 圆形缩小<BR>　　3 圆形扩大 <BR>　　4 下到上刷新 <BR>　　5 上到下刷新<BR>　　6 左到右刷新 <BR>　　7 右到左刷新 <BR>　　8 竖百叶窗<BR>　　9 横百叶窗 <BR>　　10 错位横百叶窗 <BR>　　11 错位竖百叶窗<BR>　　12 点扩散 <BR>　　13 左右到中间刷新 <BR>　　14 中间到左右刷新<BR>　　15 中间到上下<BR>　　16 上下到中间 <BR>　　17 右下到左上<BR>　　18 右上到左下 <BR>　　19 左上到右下 <BR>　　20 左下到右上<BR>　　21 横条 <BR>　　22 竖条 <BR>　　23 以上22种随机选择一种<BR><BR>39.在规定时间内跳转<BR>&lt;META http-equiv=V="REFRESH" content="5;URL=http://www.51js.com"&gt; <BR><BR>40.网页是否被检索<BR>&lt;meta name="ROBOTS" content="属性值"&gt;<BR>　　其中属性值有以下一些:<BR>　　属性值为"all": 文件将被检索，且页上链接可被查询；<BR>　　属性值为"none": 文件不被检索，而且不查询页上的链接；<BR>　　属性值为"index": 文件将被检索；<BR>　　属性值为"follow": 查询页上的链接；<BR>　　属性值为"noindex": 文件不检索，但可被查询链接；<BR>　　属性值为"nofollow": 文件不被检索，但可查询页上的链接。 <img src ="http://www.cnitblog.com/piaoye12345/aggbug/6234.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/piaoye12345/" target="_blank">萌芽的叶子</a> 2006-01-18 11:50 <a href="http://www.cnitblog.com/piaoye12345/archive/2006/01/18/6234.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>用onpropertychange即时限制输入文本的字节数 </title><link>http://www.cnitblog.com/piaoye12345/archive/2006/01/18/6235.html</link><dc:creator>萌芽的叶子</dc:creator><author>萌芽的叶子</author><pubDate>Wed, 18 Jan 2006 03:50:00 GMT</pubDate><guid>http://www.cnitblog.com/piaoye12345/archive/2006/01/18/6235.html</guid><wfw:comment>http://www.cnitblog.com/piaoye12345/comments/6235.html</wfw:comment><comments>http://www.cnitblog.com/piaoye12345/archive/2006/01/18/6235.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/piaoye12345/comments/commentRss/6235.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/piaoye12345/services/trackbacks/6235.html</trackback:ping><description><![CDATA[<DIV class=postTitle>&nbsp;</DIV>&lt;!--StartFragment--&gt;&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt;<BR>&lt;HTML&gt;<BR>&lt;HEAD&gt;<BR>&lt;META http-equiv=Content-Type content="text/html; charset=gb2312"&gt;<BR>&lt;META NAME="Author" CONTENT="Seagle.K"&gt;<BR>&lt;SCRIPT LANGUAGE="JavaScript"&gt;<BR>function limitTxtByte(o, len)<BR>{<BR>var str = o.value;<BR>var rscn = /^[\u4E00-\u9FA5]$/i;<BR>var ach;<BR>var rsstr = '';<BR>var count = 0;<BR>for (var i=0; i&lt;str.length; i++)<BR>{<BR>ach = str.substr(i, 1);<BR>if (rscn.test(ach))<BR>{<BR>if (count+2 &lt;= len)<BR>{<BR>count += 2;<BR>}else<BR>{<BR>break;<BR>}<BR>}else<BR>{<BR>if (count+1 &lt;= len)<BR>{<BR>count += 1;<BR>}else<BR>{<BR>break;<BR>}<BR>}<BR>rsstr += ach;<BR>}<BR><BR>if (rsstr != str)<BR>{<BR>o.value = rsstr;<BR>}<BR>}<BR>&lt;/SCRIPT&gt;<BR>&lt;/HEAD&gt;<BR>&lt;BODY&gt;<BR>&lt;INPUT TYPE="text" name="txt" onpropertychange="limitTxtByte(this, 4)"&gt;<BR>&lt;/BODY&gt;<BR>&lt;/HTML&gt; <img src ="http://www.cnitblog.com/piaoye12345/aggbug/6235.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/piaoye12345/" target="_blank">萌芽的叶子</a> 2006-01-18 11:50 <a href="http://www.cnitblog.com/piaoye12345/archive/2006/01/18/6235.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>web下载文件</title><link>http://www.cnitblog.com/piaoye12345/archive/2005/11/15/4547.html</link><dc:creator>萌芽的叶子</dc:creator><author>萌芽的叶子</author><pubDate>Tue, 15 Nov 2005 09:51:00 GMT</pubDate><guid>http://www.cnitblog.com/piaoye12345/archive/2005/11/15/4547.html</guid><wfw:comment>http://www.cnitblog.com/piaoye12345/comments/4547.html</wfw:comment><comments>http://www.cnitblog.com/piaoye12345/archive/2005/11/15/4547.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/piaoye12345/comments/commentRss/4547.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/piaoye12345/services/trackbacks/4547.html</trackback:ping><description><![CDATA[Response.ContentType = "application/vnd.ms-excel"&nbsp;&nbsp;&nbsp; <BR>Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim httpHeader As String = "attachment;filename=" + HttpUtility.UrlEncode("d:\cwreport\" &amp; lblReportDate.Text &amp; dpdnlstReportType.SelectedItem.Text &amp; ".xls")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim file = New System.IO.FileInfo("d:\cwreport\" &amp; dpdnlstReportType.SelectedItem.Text &amp; ".xls")<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Response.Clear()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Response.AddHeader("Content-Disposition", httpHeader)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Response.WriteFile(file.FullName)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Response.End() <BR><BR><BR>这个可以解决txt的格式文件的下载需要。如果是简单一点：<BR><BR>Response.Redirect("11.txt")<BR><BR>超连接
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">a&nbsp;href&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">11</SPAN><SPAN style="COLOR: #000000">.txt</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">111111111</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">a</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN></DIV><img src ="http://www.cnitblog.com/piaoye12345/aggbug/4547.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/piaoye12345/" target="_blank">萌芽的叶子</a> 2005-11-15 17:51 <a href="http://www.cnitblog.com/piaoye12345/archive/2005/11/15/4547.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>弹出无菜单窗体</title><link>http://www.cnitblog.com/piaoye12345/archive/2005/11/14/4448.html</link><dc:creator>萌芽的叶子</dc:creator><author>萌芽的叶子</author><pubDate>Mon, 14 Nov 2005 05:48:00 GMT</pubDate><guid>http://www.cnitblog.com/piaoye12345/archive/2005/11/14/4448.html</guid><wfw:comment>http://www.cnitblog.com/piaoye12345/comments/4448.html</wfw:comment><comments>http://www.cnitblog.com/piaoye12345/archive/2005/11/14/4448.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/piaoye12345/comments/commentRss/4448.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/piaoye12345/services/trackbacks/4448.html</trackback:ping><description><![CDATA[<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">script&nbsp;language</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">javascript</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;!--</SPAN><SPAN style="COLOR: #000000">&nbsp;<BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align=top>window.open&nbsp;('test2.aspx','newwindow','height</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">100</SPAN><SPAN style="COLOR: #000000">,width</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">200</SPAN><SPAN style="COLOR: #000000">,top</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">,left</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">,toolbar</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">no,menubar</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">no,scrollbars</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">no,resizable</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">no,location</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">no,status</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">no')&nbsp;<BR><IMG src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">--&gt;&lt;/</SPAN><SPAN style="COLOR: #000000">script</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN></DIV>
<SCRIPT language=javascript>
<!-- 
window.open ('test2.aspx','newwindow','height=100,width=200,top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no') 
--></SCRIPT>
<BR>这代码放在html的head中，运行后就有弹出的效果，也可以在后台调用<img src ="http://www.cnitblog.com/piaoye12345/aggbug/4448.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/piaoye12345/" target="_blank">萌芽的叶子</a> 2005-11-14 13:48 <a href="http://www.cnitblog.com/piaoye12345/archive/2005/11/14/4448.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>