??xml version="1.0" encoding="utf-8" standalone="yes"?>BlogJava-紫蝶∏飛揚↗-文章分类-div+css+js代码http://www.268147.live/algz/category/42183.htmlPurple Butterfly Flying QQ?7101519 Flex,Ext,Spring,Hibernate,EOS,SpringSecurity,Struts http://algz.googlecode.com/svn/trunk/zh-cnSat, 04 Aug 2012 01:17:34 GMTSat, 04 Aug 2012 01:17:34 GMT60JS 创徏c?--混合的构造函?原型方式http://www.268147.live/algz/articles/384711.html紫蝶∏飛揚↗紫蝶∏飛揚↗Fri, 03 Aug 2012 08:50:00 GMThttp://www.268147.live/algz/articles/384711.htmlhttp://www.268147.live/algz/comments/384711.htmlhttp://www.268147.live/algz/articles/384711.html#Feedback0http://www.268147.live/algz/comments/commentRss/384711.htmlhttp://www.268147.live/algz/services/trackbacks/384711.htmlJS 创徏c?--混合的构造函?原型方式
prototype:原型.此对象的所有实例共享原型定义的数据?对象)引用.一般用于防止重复创建函?费内存.
原型中定义的所有函数和引用的对象都只创Z?构造函C的方法则会随着实例的创建重复创?如果有对象或Ҏ的话).
不管在原型中q是构造函C,属??都不׃n.
创徏cȝ最好方式是用构造函数定义属性,用原型定义方法?/div>
q种方式同样适用于承机Ӟ用对象冒充承构造函数的属性,用原型链l承 prototype 对象的方法?/div>
//构造函?/div>
function Car(sColor,iDoors,iMpg) {
  this.color = sColor; //定义属?/div>
  this.doors = iDoors; //定义属?/div>
  this.mpg = iMpg;     //定义属?/div>
  this.drivers = new Array("Mike","John");//定义数组对象.每个实例创徏一个单独的对象
}
//公共Ҏ(׃n),属性不׃n.
Car.prototype={
  value:1,                        //属性不׃n
  objs:new Array("A","B"),        //对象׃n引用
  showColor : function() {        //Ҏ׃n引用.
    alert(this.color);
  }
};
var oCar1 = new Car("red",4,23);
var oCar2 = new Car("blue",3,25);
oCar1.drivers.push("Bill");       //构造方法中的对象都是各个独立的.
oCar1.value=2;                     //属性不׃n.
oCar1.objs.push('C');             //原型中的对象都是׃n引用?
document.write(oCar1.drivers + "<br/>" );
  //Mike1,John,Bill
oCar1.showColor();                         //red
document.write(oCar2.objs + "<br/>" );
     //A,B          oCar1:A,B,C
document.write( "<br/>" +oCar2.value);     //1
document.write( "<br/>" +oCar2.drivers);   //Mike1,John


]]>javascript中的IZQfalse,? 比较q算关系http://www.268147.live/algz/articles/371885.html紫蝶∏飛揚↗紫蝶∏飛揚↗Wed, 14 Mar 2012 13:30:00 GMThttp://www.268147.live/algz/articles/371885.htmlhttp://www.268147.live/algz/comments/371885.htmlhttp://www.268147.live/algz/articles/371885.html#Feedback0http://www.268147.live/algz/comments/commentRss/371885.htmlhttp://www.268147.live/algz/services/trackbacks/371885.htmljavascript中的 IZQfalse,?
包含了一个运的规则Q相{运符判断Ӟ
其中一个是trueQ先转换?(false则{换ؓ0)再做比较?nbsp;
"" == falseQ现false转化?Q即Q判?" == 0?/div>
IZ转换成数?Q?==0Q所?nbsp;
alert("" == false)昄的是true?nbsp;


]]>JS 数组对象的JohnҎhttp://www.268147.live/algz/articles/367520.html紫蝶∏飛揚↗紫蝶∏飛揚↗Thu, 29 Dec 2011 10:23:00 GMThttp://www.268147.live/algz/articles/367520.htmlhttp://www.268147.live/algz/comments/367520.htmlhttp://www.268147.live/algz/articles/367520.html#Feedback0http://www.268147.live/algz/comments/commentRss/367520.htmlhttp://www.268147.live/algz/services/trackbacks/367520.html
<script type="text/javascript">
var arr = new Array(3)
arr[0] = "George"
arr[1] = "John"
arr[2] = "Thomas"
document.write(arr.join("."))
</script>
输出Q?/div>
George.John.Thomas


]]>
[转] 面中调用系l常用的对话框需要用到的classidhttp://www.268147.live/algz/articles/365132.html紫蝶∏飛揚↗紫蝶∏飛揚↗Tue, 29 Nov 2011 09:50:00 GMThttp://www.268147.live/algz/articles/365132.htmlhttp://www.268147.live/algz/comments/365132.htmlhttp://www.268147.live/algz/articles/365132.html#Feedback0http://www.268147.live/algz/comments/commentRss/365132.htmlhttp://www.268147.live/algz/services/trackbacks/365132.html■打开■ 
<input name=Button onClick=document.all.WebBrowser.ExecWB(1,1) type=button value=打开> 
<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT> 
■另存?#9632; 
<input name=Button onClick=document.all.WebBrowser.ExecWB(4,1) type=button value=另存?gt;<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT> 
■属?#9632; 
<input name=Button onClick=document.all.WebBrowser.ExecWB(10,1) type=button value=属?gt;<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT> 
■打印■ 
<input name=Button onClick=document.all.WebBrowser.ExecWB(6,1) type=button value=打印><OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT> 
■打印预览■ 
<input name=Button onClick=document.all.WebBrowser.ExecWB(7,1) type=button value=打印><OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT> 

■面讄■ 
<input name=Button onClick=document.all.WebBrowser.ExecWB(8,1) type=button value=面讄><OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT> 
■h■ 
<input type=button value=h name=refresh onclick="window.location.reload()"> 
■导入收藏■ 
<input type="button" name="Button" value="导入收藏? onClick=window.external.ImportExportFavorites(true,);> 
■导出收藏■ 
<input type="button" name="Button3" value="导出收藏? onClick=window.external.ImportExportFavorites(false,);> 
■加入收藏■ 
<INPUT name=Button2 onclick="window.external.AddFavorite(location.href, document.title)" type=button value=加入收藏?gt; 
■整理收藏?#9632; 
<INPUT name=Submit2 onclick="window.external.ShowBrowserUI(OrganizeFavorites, null)" type=button value=整理收藏?gt; 
■查看原文?#9632; 
<INPUT name=Button onclick=window.location = "view-source:" + window.location.href type=button value=查看源文?gt; 
■语言讄■ 
<INPUT name=Button onclick="window.external.ShowBrowserUI(LanguageDialog, null)" type=button value=语言讄> 
■前进■ 
<INPUT name=Submit onclick=history.go(1) type=submit value=前进> 
■后退■ 
<INPUT name=Submit2 onclick=history.go(-1) type=submit value=后退>

]]>
[转] WebBrowser.ExecWB的完整说?/title><link>http://www.268147.live/algz/articles/365131.html</link><dc:creator>紫蝶∏飛揚↗</dc:creator><author>紫蝶∏飛揚↗</author><pubDate>Tue, 29 Nov 2011 09:48:00 GMT</pubDate><guid>http://www.268147.live/algz/articles/365131.html</guid><wfw:comment>http://www.268147.live/algz/comments/365131.html</wfw:comment><comments>http://www.268147.live/algz/articles/365131.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.268147.live/algz/comments/commentRss/365131.html</wfw:commentRss><trackback:ping>http://www.268147.live/algz/services/trackbacks/365131.html</trackback:ping><description><![CDATA[<span class="Apple-style-span" style="color: #555555; font-family: 宋体, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff; "><div class="article" id="article" align="left" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><table id="content" cellspacing="10" cellpadding="0" width="650" border="0" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; font-size: 12px; table-layout: fixed; width: 650px; "><tbody style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><tr style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 12px; "><td style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 12px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 10pt; "><font style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: #ffffff; "><OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT> <br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><input name=Button .Click=document.all.WebBrowser.ExecWB(1,1) type=button value=打开><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><input name=Button .Click=document.all.WebBrowser.ExecWB(2,1) type=button value=关闭所?gt;<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><input name=Button .Click=document.all.WebBrowser.ExecWB(4,1) type=button value=另存?gt; <br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><input name=Button .Click=document.all.WebBrowser.ExecWB(6,1) type=button value=打印><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><input name=Button .Click=document.all.WebBrowser.ExecWB(6,6) type=button value=直接打印><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><input name=Button .Click=document.all.WebBrowser.ExecWB(7,1) type=button value=打印预览><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><input name=Button .Click=document.all.WebBrowser.ExecWB(8,1) type=button value=面讄><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><input name=Button .Click=document.all.WebBrowser.ExecWB(10,1) type=button value=属?gt;<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><input name=Button .Click=document.all.WebBrowser.ExecWB(17,1) type=button value=全?gt;<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><input name=Button .Click=document.all.WebBrowser.ExecWB(22,1) type=button value=h><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><input name=Button .Click=document.all.WebBrowser.ExecWB(45,1) type=button value=关闭></font></div></td></tr></tbody></table></div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">WebBrowserlg的execWBҎ</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">1. <object id="WebBrowser" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">2. 调用Ҏ:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">WebBrowser.ExecWB nCmdID, nCmdExecOpt, [pvaIn], [pvaOut]</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">3. 参数说明:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">(a).nCmdID </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_OPEN = 1, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_NEW = 2, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_SAVE = 3, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_SAVEAS = 4, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_SAVECOPYAS = 5, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_PRINT = 6, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_PRINTPREVIEW = 7, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_PAGESETUP = 8, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_SPELL = 9, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_PROPERTIES = 10, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_CUT = 11, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_COPY = 12, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_PASTE = 13, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_PASTESPECIAL = 14, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_UNDO = 15, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_REDO = 16, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_selectALL = 17, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_CLEARselectION = 18, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_ZOOM = 19, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_GETZOOMRANGE = 20 </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_updateCOMMANDS = 21 </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_REFRESH = 22 </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_STOP = 23 </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_HIDETOOLBARS = 24 </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_SETPROGRESSMAX = 25 </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_SETPROGRESSPOS = 26 </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_SETPROGRESSTEXT = 27 </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_SETTITLE = 28 </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_SETDOWNLOADSTATE = 29 </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDID_STOPDOWNLOAD = 30 </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">上面的关键词都可以在览器的菜单里面扑ֈ对应的选项H大家一看就明白的﹗ </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">(b).nCmdExecOpt </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDEXECOPT_DODEFAULT = 0, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDEXECOPT_PROMPTUSER = 1, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">LECMDEXECOPT_DONTPROMPTUSER = 2, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OLECMDEXECOPT_SHOWHELP = 3 </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">对于q个参数H一般来_?可以了?/div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">4.常用:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">WebBrowser.ExecWB(1,1) 打开</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">WebBrowser.ExecWB(2,1) 关闭现在所有的IEH口Qƈ打开一个新H口</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">WebBrowser.ExecWB(4,1) 保存|页</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">WebBrowser.ExecWB(6,1) 打印</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">WebBrowser.ExecWB(7,1) 打印预览</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">WebBrowser.ExecWB(8,1) 打印面讄</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">WebBrowser.ExecWB(10,1) 查看面属?/div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">WebBrowser.ExecWB(15,1) 好像是撤销Q有待确?/div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">WebBrowser.ExecWB(17,1) 全?/div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">WebBrowser.ExecWB(22,1) h</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">WebBrowser.ExecWB(45,1) 关闭H体无提C?/div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">5.CZH?/div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">(a)调用IE?#8221;另存?#8221;功能的示例﹕</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><object id="WebBrowser" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href=".:WebBrowser.ExecWB(4,1);">Save-存储</A></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">(b)l过改写的登陆模?/div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><object id="WebBrowser" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><body .load="showModalDialog('login_access.asp',0,'Status:NO;dialogWidth:418px;dialogHeight:288px');document.all.WebBrowser.ExecWB(45,1);"></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT> </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><input name=Button .Click=document.all.WebBrowser.ExecWB(1,1) type=button value=打开></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><input name=Button .Click=document.all.WebBrowser.ExecWB(2,1) type=button value=关闭所?gt;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><input name=Button .Click=document.all.WebBrowser.ExecWB(4,1) type=button value=另存?gt; </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><input name=Button .Click=document.all.WebBrowser.ExecWB(6,1) type=button value=打印></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><input name=Button .Click=document.all.WebBrowser.ExecWB(6,6) type=button value=直接打印></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><input name=Button .Click=document.all.WebBrowser.ExecWB(7,1) type=button value=打印预览></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><input name=Button .Click=document.all.WebBrowser.ExecWB(8,1) type=button value=面讄></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><input name=Button .Click=document.all.WebBrowser.ExecWB(10,1) type=button value=属?gt;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><input name=Button .Click=document.all.WebBrowser.ExecWB(17,1) type=button value=全?gt;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><input name=Button .Click=document.all.WebBrowser.ExecWB(22,1) type=button value=h></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><input name=Button .Click=document.all.WebBrowser.ExecWB(45,1) type=button value=关闭></div></span><img src ="http://www.268147.live/algz/aggbug/365131.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.268147.live/algz/" target="_blank">紫蝶∏飛揚↗</a> 2011-11-29 17:48 <a href="http://www.268147.live/algz/articles/365131.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>自已~写的基于EOS框架的树形表格控?/title><link>http://www.268147.live/algz/articles/347485.html</link><dc:creator>紫蝶∏飛揚↗</dc:creator><author>紫蝶∏飛揚↗</author><pubDate>Fri, 01 Apr 2011 09:39:00 GMT</pubDate><guid>http://www.268147.live/algz/articles/347485.html</guid><wfw:comment>http://www.268147.live/algz/comments/347485.html</wfw:comment><comments>http://www.268147.live/algz/articles/347485.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.268147.live/algz/comments/commentRss/347485.html</wfw:commentRss><trackback:ping>http://www.268147.live/algz/services/trackbacks/347485.html</trackback:ping><description><![CDATA[<p>思\: 先查询出所有数据的根结?q对每个根结Ҏ查是不是有子l点,如果有子l点则在昄时增?+"囄,没有则不d.但用L?+"囄?则通过AJAX调用逻辑查询触发结点的所有子l点(采用递归方式,以每个子l点的父l点属性从上向下查?,q藏加载到触发l点后面(以TR形式d,q设|每个子元素的paraTaskno属性ؓ父结点taskno(其实仍是以递归方式,从上向下l每个子元素的paraTaskno属性设|父元素的id)<br /> <br /> 服务端数? 仅查询根l点.<br /> <br /> html代码:<br />   <br /> <viewlist id="e587ead4-daa3-431e-a0ed-fac40e013850"><br />   <h:form name="page_form" action="com.bos.mp.taskStatistics.TaskStatistics.flow" method="post"><br />     <input type="hidden" name="_eosFlowAction" value="pageQuery" ><br />     <h:hiddendata property="criteria" /><br />     <h:hidden property="page/begin"/><br />     <h:hidden property="page/length"/><br />     <h:hidden property="page/count"/><br />     <h:hidden property="page/isCount"/><br />     <w:panel id="list_panel" width="100%" title="d列表"><br />       <table align="center" border="0" width="100%" class="EOS_table"><br />         <tr id="table_header">        <br />           <th><br />             d名称<br />           </th><br />           <th><br />             目名称<br />           </th><br />           <th><br />             目模块<br />           </th><br />           <th><br />             工作占项目比?br />           </th><br />           <th><br />             负责?br />           </th><br />        <th><br />             审核?br />           </th><br />           <th><br />             计划开始日<br />           </th><br />            <th><br />             计划完成?br />           </th><br />           <th><br />             d状?br />           </th><br />           <th><br />            完成?%)<br />           </th><br />           <th><br />            更新日期<br />           </th><br />           <th><br />            原因<br />           </th><br />           <th><br />            实际完成?%)<br />           </th><br />           <th><br />            实际完成?br />           </th><br />           <th><br />            提前/滞后完成天数<br />           </th><br />         </tr><br />         <w:checkGroup id="group1"><br />           <l:iterate property="mpprojectfollows" id="id1"><br />            <%<br />             long temp = 0;<br />             if(null != ((DataObject)pageContext.getAttribute("id1")).getString("proEndDate")){<br />              DataObject t=(DataObject)pageContext.getAttribute("id1");<br />              String d1 = ((DataObject)pageContext.getAttribute("id1")).getString("comDate") == null ? new SimpleDateFormat("yyyy-MM-dd").format(new Date()):((DataObject)pageContext.getAttribute("id1")).getString("comDate");<br />              String d2 = ((DataObject)pageContext.getAttribute("id1")).getString("proEndDate");<br />              temp = RetOrgInfo.daysDifference(d1,d2);<br />             }<br />             if(temp<0 && !((DataObject)pageContext.getAttribute("id1")).getString("taskStatus").equals("完成")){<br />              out.print("<tr class='EOS_table_row' style='background-color:red;' id='"+((DataObject)pageContext.getAttribute("id1")).getString("taskno")+"'>");<br />             }else if(temp<0 && ((DataObject)pageContext.getAttribute("id1")).getString("taskStatus").equals("完成")){<br />              out.print("<tr class='EOS_table_row' style='background-color:orange;' id='"+((DataObject)pageContext.getAttribute("id1")).getString("taskno")+"'>");<br />             }else if(temp>0 && ((DataObject)pageContext.getAttribute("id1")).getString("taskStatus").equals("完成")){<br />              out.print("<tr class='EOS_table_row'  style='background-color:green;' id='"+((DataObject)pageContext.getAttribute("id1")).getString("taskno")+"'>");<br />             }else{<br />              out.print("<tr class='EOS_table_row' id='"+((DataObject)pageContext.getAttribute("id1")).getString("taskno")+"'>");<br />             }<br />             %><br />             <br />              <td align="left" ><br />              <l:present  property="childTasks" iterateId="id1"><br />                <img src="<%=request.getContextPath() %>/common/skins/default/images/grouppanel/grouppanel_open.gif" onclick="node_click('<b:write iterateId="id1" property="taskno"/>');"/><br />               </l:present><br />               <h:hidden iterateId="id1" property="paraTaskno"/></p> <p>                <a href="#" onclick="javascript:showTaskDet('<b:write iterateId="id1" property="taskno"/>');"><b:write iterateId="id1" property="taskName"/></a><br />               </td><br />               <td align="center"><br />                 <b:write iterateId="id1" property="projectName"/><br />               </td><br />               <td align="center"><br />                 <b:write iterateId="id1" property="modName"/><br />               </td><br />               <td align="center"><br />                 <b:write iterateId="id1" property="taskRate"/><br />                 <l:notEmpty iterateId="id1" property="taskRate"><br />                  %<br />                 </l:notEmpty><br />               </td><br />               <td align="center"><br />                 <b:write iterateId="id1" property="planPres"/><br />               </td><br />               <td align="center"><br />                 <b:write iterateId="id1" property="auditorName"/><br />               </td><br />               <td align="center"><br />                 <b:write iterateId="id1" property="proStarDate" formatPattern="yyyy-MM-dd"/><br />               </td><br />               <td align="center"><br />                 <b:write iterateId="id1" property="proEndDate" formatPattern="yyyy-MM-dd"/><br />               </td><br />                <td align="center"><br />                 <b:write iterateId="id1" property="taskStatus"/><br />               </td>      <br />               <td align="center"><br />                 <b:write iterateId="id1" property="actorRated"/><br />               </td><br />               <td align="center"><br />                 <b:write iterateId="id1" property="actorDate" formatPattern="yyyy-MM-dd"/><br />               </td><br />               <td align="center"><br />                 <b:write iterateId="id1" property="reason"/><br />               </td><br />               <td align="center"><br />                 <b:write iterateId="id1" property="auditRate"/><br />               </td><br />                <td align="center"><br />                 <b:write iterateId="id1" property="comDate" formatPattern="yyyy-MM-dd"/><br />               </td><br />               <td align="center"><br />                <%<br />                 if(temp<0){<br />                  out.print("滞后"+Math.abs(temp)+"?);<br />                 }else if(temp>0 && ((DataObject)pageContext.getAttribute("id1")).getString("taskStatus").equals("完成")){<br />                  out.print("提前"+temp+"?);<br />                 }<br />                 %><br />               </td><br />             </tr><br />           </l:iterate><br />         </w:checkGroup><br />         <tr><br />           <td colspan="16" class="command_sort_area"><br />            <div id="pageroot" align="right"><br />               <l:equal property="page/isCount" targetValue="true"><br />                 ?br />                 <b:write property="page/count"/><br />                 条记?W?br />                 <b:write property="page/currentPage"/><br />                 ?<br />                 <b:write property="page/totalPage"/><br />                 ?br />               </l:equal><br />               <l:equal property="page/isCount" targetValue="false"><br />                 W?br />                 <b:write property="page/currentPage"/><br />                 ?br />               </l:equal><br />               <input type="button" onclick="firstPage('page', 'pageQuery', null, null, 'page_form');" value="首页"  <l:equal property="page/isFirst" targetValue="true">disabled</l:equal> ><br />               <input type="button" onclick="prevPage('page', 'pageQuery', null, null, 'page_form');" value="上页" <l:equal property="page/isFirst" targetValue="true">disabled</l:equal> ><br />               <input type="button" onclick="nextPage('page', 'pageQuery', null, null, 'page_form');" value="下页" <l:equal property="page/isLast" targetValue="true">disabled</l:equal> ><br />               <l:equal property="page/isCount" targetValue="true"><br />                 <input type="button" onclick="lastPage('page', 'pageQuery', null, null, 'page_form');" value="N" <l:equal property="page/isLast" targetValue="true">disabled</l:equal> ><br />               </l:equal><br />             </div><br />           </td><br />         </tr><br />       </table><br />     </w:panel><br />   </h:form><br /> </viewlist></p> <p><br /> <br /> <script> <br /> var jquery = jQuery.noConflict();<br />     //ȝ点展开/收v<br />     function node_click(taskid){<br />        var el=jquery("#"+taskid).find("img")[0]//event.srcElement<br />        var path=el.src.substr(el.src.lastIndexOf("/")+1)<br />        var prifix=el.src.substr(0,el.src.lastIndexOf("/"))<br />        if(path=="grouppanel_open.gif"){<br />           //昄l点<br />           var tr=jquery(el).closest("tr");<br />           if(jquery(el).closest("tr").next().css("display")=="none"){<br />             el.src=prifix+"/grouppanel_close.gif";<br />             tr.nextAll("tr[paraTaskno='"+tr.attr("id")+"']").show();<br />           }else{<br />             readchildnodeByAjax(taskid);<br />             jquery(el).trigger("click");<br />           }<br />           <br />        }else{<br />           //隐藏l点<br />           el.src=prifix+"/grouppanel_open.gif";<br />           var tr=jquery(el).closest("tr");<br />           recursion_node(tr,false);<br />        }<br />     }<br />     <br />     //ajaxd子结?br />     function readchildnodeByAjax(taskid){<br />        var myAjax=new Ajax("com.bos.mp.projectfollow.mpprojectfollowbiz.QueryTask.biz");<br />        myAjax.addParam("criteria/_entity","com.bos.mp.projectfollow.dataset.ProTaskQryEntity");<br />        myAjax.addParam("criteria/_expr[0]/paraTaskno",taskid);<br />        myAjax.submit();<br />        //获取"root/data/mpprojectfollows"l点数组<br />        var nodes=myAjax.getXMLDom().selectNodes("root/data/mpprojectfollows");<br />        for(var i=0;i<nodes.length;i++){<br />           addElement(jquery("#"+taskid),nodes[i]);<br />        }<br />     }<br />     <br />     /**<br />      *动态增加trl点,以请求的服务端数据来遍历dl点<br />      *template:html面元素;node:服务端数据子实体<br />      */<br />     function addElement(template,node){<br />       var xml=jquery(node);<br />       var template=addnode(template,xml)<br />       var childnodes=xml.children("childTasks");<br />       for(var i=0;i<childnodes.length&&jquery(xml.children("childTasks")[i]).text()!="";i++){<br />           addElement(template,xml.children("childTasks")[i]);<br />       }<br />     }<br />      <br />     /**<br />      *以服务端的子实体对象(xml)构造一个结Ҏ加到html元素(template)<br />      */<br />     function addnode(template,xml){<br />            var open_gif='<%=request.getContextPath() %>/common/skins/default/images/grouppanel/grouppanel_open.gif';<br />            var close_gif="<%=request.getContextPath() %>/common/skins/default/images/grouppanel/grouppanel_close.gif"<br />            //从模板结Ҏ造出目标l点tr<br />            var curtr=template.clone().insertAfter(template).hide()<br />                 .attr("id",jquery(xml.find("taskno")[0]).text())<br />                 .attr("paraTaskno",jquery(xml.find("paraTaskno")[0]).text());<br />            //首个TDl点      <br />            var firsttd=jquery(curtr.children("td")[0]);<br />            var td=jquery(curtr.children("td")[0]).css("padding-left",parseInt(firsttd.css("padding-left"))+10+"px")<br />                .empty();<br />                jquery("<a href='#'></a>").text(jquery(xml.find("taskName")[0]).text())<br />                .bind("click",function(){<br />                                 showTaskDet(jquery(xml.find("taskno")[0]).text());<br />                              }).appendTo(td);<br />            var img=jquery("<img/>").prependTo(td);<br />            if(jquery(xml.children("childTasks")[0]).text()!=""){<br />               //非叶子结?l定事g<br />               img.attr("src",open_gif);<br />               img.bind("click",function(){<br />                                   var path=jquery(this).attr("src");<br />                                   var tr=jquery(this).closest("tr");<br />                                   if(path==open_gif){<br />                                      jquery(this).attr("src",close_gif);<br />                                      recursion_node(tr,true);<br />                                   }else{<br />                                      jquery(this).attr("src",open_gif);<br />                                      recursion_node(tr,false);<br />                                   }<br />                                  })<br />             }else{<br />               //叶子l点<br />               img.attr("src",close_gif);<br />             }<br />             td.next().empty()//text(jquery(xml.find("projectName")[0]).text())<br />             .next().empty()//text(jquery(xml.find("modName")[0]).text())<br />             .next().text(jquery(xml.find("taskRate")[0]).text())<br />             .next().text(jquery(xml.find("planPres")[0]).text())<br />             .next().text(jquery(xml.find("auditorName")[0]).text())<br />             .next().text(jquery(xml.find("proStarDate")[0]).text())<br />             .next().text(jquery(xml.find("proEndDate")[0]).text())<br />             .next().text(jquery(xml.find("taskStatus")[0]).text())<br />             .next().text(jquery(xml.find("actorRated")[0]).text())<br />             .next().text(jquery(xml.find("actorDate")[0]).text())<br />             .next().text(jquery(xml.find("reason")[0]).text())<br />             .next().text(jquery(xml.find("auditRate")[0]).text())<br />             .next().text(jquery(xml.find("comDate")[0]).text())<br />             .next().text("");<br />             return curtr;<br />       }<br />     <br />     /**<br />      *层叠递归方式昄或隐藏结?br />      * node:jquery对象;isshow:boolean?br />      */<br />     function recursion_node(node,isshow){<br />       var open_gif='<%=request.getContextPath() %>/common/skins/default/images/grouppanel/grouppanel_open.gif';<br />       var close_gif="<%=request.getContextPath() %>/common/skins/default/images/grouppanel/grouppanel_close.gif"<br />       var nodes=node.nextAll("tr[paraTaskno='"+node.attr("id")+"']")</p> <p>      for(var i=0;i<nodes.length;i++){<br />           recursion_node(jquery(nodes[i]),isshow);<br />           if(!isshow){<br />             jquery(nodes[i]).hide();<br />           }else{<br />            jquery(nodes[i]).show();<br />           }<br />       }<br />       if(nodes.length>0){<br />       jquery(node.find("img")[0]).attr("src",!isshow?open_gif:close_gif)<br />       }</p> <p>    }</p> </script><br /> <img src ="http://www.268147.live/algz/aggbug/347485.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.268147.live/algz/" target="_blank">紫蝶∏飛揚↗</a> 2011-04-01 17:39 <a href="http://www.268147.live/algz/articles/347485.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>jquery与mootools框架冲突的解x?/title><link>http://www.268147.live/algz/articles/347219.html</link><dc:creator>紫蝶∏飛揚↗</dc:creator><author>紫蝶∏飛揚↗</author><pubDate>Tue, 29 Mar 2011 07:53:00 GMT</pubDate><guid>http://www.268147.live/algz/articles/347219.html</guid><wfw:comment>http://www.268147.live/algz/comments/347219.html</wfw:comment><comments>http://www.268147.live/algz/articles/347219.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.268147.live/algz/comments/commentRss/347219.html</wfw:commentRss><trackback:ping>http://www.268147.live/algz/services/trackbacks/347219.html</trackback:ping><description><![CDATA[<p>使用 <strong>jQuery.noConflict();</strong> <span style="font-family: Arial, Helvetica, sans-serif; color: #ffffff; font-size: 14px; font: normal normal normal medium/normal Simsun; " ><font color="#000000">q行q个函数变?的控制权让渡l第一个实现它的那个库?/font></span></p> <p><span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: medium Simsun; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(0,0,0); word-spacing: 0px;" ><span style="text-indent: 28px; font-family: Arial, Helvetica, sans-serif; color: rgb(255,255,255); font-size: 14px" ><span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: medium Simsun; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(0,0,0); word-spacing: 0px;" ><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(255,255,255); font-size: 12px" ><font color="#000000">var j = jQuery.noConflict();<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /> // Z jQuery 的代?br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /> j("div p").hide();<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /> // Z其他库的 $() 代码<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /> $("content").style.display = 'none';</font></span></span></span></span></p> <img src ="http://www.268147.live/algz/aggbug/347219.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.268147.live/algz/" target="_blank">紫蝶∏飛揚↗</a> 2011-03-29 15:53 <a href="http://www.268147.live/algz/articles/347219.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>IE6 Select元素无法被div{元素覆盖的bug解决办法http://www.268147.live/algz/articles/343101.html紫蝶∏飛揚↗紫蝶∏飛揚↗Mon, 17 Jan 2011 08:34:00 GMThttp://www.268147.live/algz/articles/343101.htmlhttp://www.268147.live/algz/comments/343101.htmlhttp://www.268147.live/algz/articles/343101.html#Feedback0http://www.268147.live/algz/comments/commentRss/343101.htmlhttp://www.268147.live/algz/services/trackbacks/343101.html .T_iframe  
{  
    position: absolute;/*l对定位保证iframe不会占用布局I间*/  
    width: 100%;    /*100%保证可以覆盖整个div*/  
    height: 100%;  
    z-index:-1; /*-1保证iframe昄在div下方*/  
}  
.T_div  
{  
    position: absolute;  
    left:100px;  
    top:50px;  
    width: 300px;  
    height: 200px;  
    background : blue;    
    z-index:100;  
}  
<div class="T_div"> 
     <span>q里可以包含其他dom元素</span> 
     <iframe class="T_iframe"></iframe> 
</div>
二种:隐藏select元素(EOS做法)
三种:用iframe括vselect元素(ȝ,没测?
<iframe class="T_iframe">
    <select>
       <option>123</option>
    </select>
</iframe> 


]]>
IE6下相对定位元?DIV)内绝对定位元?DIV)的偏Ud位Bug问题---外围DIV指定相对定位,内含DIV采用l对定位,可让DIV内多个DIV块元素L布局http://www.268147.live/algz/articles/342943.html紫蝶∏飛揚↗紫蝶∏飛揚↗Thu, 13 Jan 2011 09:52:00 GMThttp://www.268147.live/algz/articles/342943.htmlhttp://www.268147.live/algz/comments/342943.htmlhttp://www.268147.live/algz/articles/342943.html#Feedback1http://www.268147.live/algz/comments/commentRss/342943.htmlhttp://www.268147.live/algz/services/trackbacks/342943.html        IE6下相对定位元?DIV)内绝对定位元?DIV)的偏Ud位Bug问题Q即l对定位元素的相对偏Ud素是谁。一般情况下Q是相对于父元素以上直到DOCUMENTQ默认已定位Q的已定位元素(即position的设|?。但在IE6QIE5中出现的BUG却是定位在已定位元素的外围或以DOCUMENT相对而言?br />
在《精通CSS?0上面有q样一D话Q?br /> 引用:
相对于相对定位的先元素Ҏq行l对定位Q这在大多数C览器中实现得很好。但是,在windows上的IE5.5和IE6中有一个BUGQ?span style="color: #808000">如果试图相对于相对定位的?/span>的右Ҏ底部讄l对定位的框的位|?/span>Q那?span style="color: #808000">需?/span>保相对定位的框已经讄了尺?/span>。如果没有,那么IE会相对于d定位q个框。简单的解决Ҏ时ؓ相对定位的框讄宽度和高度?br />
但是Q如果未d宽度Q那么浏览器可能l予父元素默认的100%宽度。而若未添加高?/span>Q?span style="color: #339966">在Firefox 3及IE 6下都无法看到l对定位的子元素?/span>。也是_IE 6下绝对定位子元素q没有相对于d定位?br />
试通过没有问题Q?/p> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title></title>
  <style type="text/css">
    * { margin:0;padding:0;}
    #brading{
      position:relative;
      width:200px;   //可设|?00%
      height:200px;   //可设|?00%
      border:1px solid red;
      background:#ccc;
    }
    #brading .tel{
      position:absolute;
      bottom: 0;
    }
  </style>
</head>
<body>
  <div id="brading"><div class="tel">tel:000-000-999</div></div>
</body>
</html>

]]>
按回车键q校验成功后提交表单http://www.268147.live/algz/articles/342905.html紫蝶∏飛揚↗紫蝶∏飛揚↗Thu, 13 Jan 2011 02:35:00 GMThttp://www.268147.live/algz/articles/342905.htmlhttp://www.268147.live/algz/comments/342905.htmlhttp://www.268147.live/algz/articles/342905.html#Feedback0http://www.268147.live/algz/comments/commentRss/342905.htmlhttp://www.268147.live/algz/services/trackbacks/342905.html //13:回R?37:左箭?38:上箭?39:右箭?40:下箭?32:I格;8:删除;219:【或[;
function post()
{
 if(window.event.keyCode==13&&chkForm())
 {
  document.forms[0].submit();
 }
}

]]>
转换Ҏ半角为全角字W?q制标{?tag)字符长度(digit)http://www.268147.live/algz/articles/342904.html紫蝶∏飛揚↗紫蝶∏飛揚↗Thu, 13 Jan 2011 02:32:00 GMThttp://www.268147.live/algz/articles/342904.htmlhttp://www.268147.live/algz/comments/342904.htmlhttp://www.268147.live/algz/articles/342904.html#Feedback0http://www.268147.live/algz/comments/commentRss/342904.htmlhttp://www.268147.live/algz/services/trackbacks/342904.html //调用方式:onkeyup='checkchar(this,60)'
function checkchar(tag,digit){
if(tag.value==""||window.event.keyCode==37||
  window.event.keyCode==38||window.event.keyCode==39||window.event.keyCode==40
){return;}
      var str=tag.value;
      str=str.replace(/\[/g, "?)
      str=str.replace(/\(/g,"Q?);
      str=str.replace(/\)/g,"Q?);
      str=str.replace(/\,/g,"Q?);
      str=str.replace(/\;/g,"Q?);
      str=str.replace(/\:/g,"Q?);
      str=str.replace(/\[/g,"?);
      str=str.replace(/\]/g,"?);
      str=str.replace(/\./g,"?);
      tag.value=str;
      checklength(tag,digit);
}

]]>
校验输入字符是否为数字类?/title><link>http://www.268147.live/algz/articles/342902.html</link><dc:creator>紫蝶∏飛揚↗</dc:creator><author>紫蝶∏飛揚↗</author><pubDate>Thu, 13 Jan 2011 02:31:00 GMT</pubDate><guid>http://www.268147.live/algz/articles/342902.html</guid><wfw:comment>http://www.268147.live/algz/comments/342902.html</wfw:comment><comments>http://www.268147.live/algz/articles/342902.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.268147.live/algz/comments/commentRss/342902.html</wfw:commentRss><trackback:ping>http://www.268147.live/algz/services/trackbacks/342902.html</trackback:ping><description><![CDATA[<p>//校验输入字符是否为数字类?调用Ҏ:<span style="color: #99cc00"><span style="color: #339966">onkeypress="return isNumbers(event)"</span><br /> </span>function isNumbers(e)<br /> {<br /> var keynum<br /> var keychar<br /> var numcheck</p> <p>if(window.event) // IE<br />   {<br />   keynum = e.keyCode<br />   }<br /> else if(e.which) // Netscape/Firefox/Opera<br />   {<br />   keynum = e.which<br />   }<br /> keychar = String.fromCharCode(keynum)<br /> numcheck = /^(0|[1-9]\d*)$/<br /> return numcheck.test(keychar)<br /> }</p> <img src ="http://www.268147.live/algz/aggbug/342902.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.268147.live/algz/" target="_blank">紫蝶∏飛揚↗</a> 2011-01-13 10:31 <a href="http://www.268147.live/algz/articles/342902.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>限制标签(tag)字符?digit),过长度不能在输?/title><link>http://www.268147.live/algz/articles/342903.html</link><dc:creator>紫蝶∏飛揚↗</dc:creator><author>紫蝶∏飛揚↗</author><pubDate>Thu, 13 Jan 2011 02:31:00 GMT</pubDate><guid>http://www.268147.live/algz/articles/342903.html</guid><wfw:comment>http://www.268147.live/algz/comments/342903.html</wfw:comment><comments>http://www.268147.live/algz/articles/342903.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.268147.live/algz/comments/commentRss/342903.html</wfw:commentRss><trackback:ping>http://www.268147.live/algz/services/trackbacks/342903.html</trackback:ping><description><![CDATA[//限制标签(tag)字符?digit),过长度不能在输?字符包括汉字(一个汉字在UTF-8数据库中代表3个字W?和全?全角相当于一个汉?.<br /> //调用方式:onkeyup='checklength(this,60)'<br /> function checklength(tag,digit){<br /> var str=tag.value,ts="";<br /> var n=0;<br /> for(i=0;i<str.length;i++){<br />    var leg=str.charCodeAt(i);<br />    if(leg>255){    //>255,2^8-1=255,即一个字?一个汉字占二个字节.<br />      n+=3;          //oracle 限定一个汉字是三个字符<br />    }else {<br />     n+=1;<br />    }<br />    if (n>digit){<br />    tag.value=ts<br />    return;<br /> }<br />   ts+=str.charAt(i);<br /> }<br /> } <img src ="http://www.268147.live/algz/aggbug/342903.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.268147.live/algz/" target="_blank">紫蝶∏飛揚↗</a> 2011-01-13 10:31 <a href="http://www.268147.live/algz/articles/342903.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JS函数 验证日期合法(试通过)http://www.268147.live/algz/articles/335682.html紫蝶∏飛揚↗紫蝶∏飛揚↗Wed, 20 Oct 2010 05:38:00 GMThttp://www.268147.live/algz/articles/335682.htmlhttp://www.268147.live/algz/comments/335682.htmlhttp://www.268147.live/algz/articles/335682.html#Feedback0http://www.268147.live/algz/comments/commentRss/335682.htmlhttp://www.268147.live/algz/services/trackbacks/335682.html<script type="text/javascript">
 alert("2008-05-11是日期吗?{?"+isDateFormat("2008-05-11"));

 function isDateFormat(txt){ //是否为合法的日期格式:YYYY-MM-DD
if(txt==null || txt == ""){return false;}
else{
   var regex = /[0-9]{1,4}-[0-9]{1,2}-[0-9]{1,2}/;   //可按具体格式修改
   if( regex.test(txt) ){
    var noArr = txt.split("-");
    var year = eval(noArr[0]);
    var month = eval(noArr[1]);
    var day = eval(noArr[2]);
    if ( year < 1 || month < 1 || month > 12 || day < 1 || day > 31) {return false;}
    if ((month == 4 || month == 6 || month == 9 || month == 11) && day > 30){return false;}
    if (month == 2){
     if ((year % 4 != 0) && day > 29) { return false;}
     if (year % 4 == 0){
      if(year % 100 == 0 && year % 400 != 0 && day > 29){return false;}
      else if (day > 28){ return false;}
     }
    }
    return true;
   }else{return false;}
}
}

 
</script>



]]>
不错的JS 验证w䆾证的代码http://www.268147.live/algz/articles/333069.html紫蝶∏飛揚↗紫蝶∏飛揚↗Mon, 27 Sep 2010 09:26:00 GMThttp://www.268147.live/algz/articles/333069.htmlhttp://www.268147.live/algz/comments/333069.htmlhttp://www.268147.live/algz/articles/333069.html#Feedback0http://www.268147.live/algz/comments/commentRss/333069.htmlhttp://www.268147.live/algz/services/trackbacks/333069.html <head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body onload="init()" >
<form  method=post name="creator" >
<script language="javascript">
<!--
var where = new Array(35);
function comefrom(loca,locacity) { this.loca = loca; this.locacity = locacity; }
where[0]= new comefrom("请选择省䆾?,"请选择城市?);
where[1] = new comefrom("北京","|东城|西城|崇文|宣武|朝阳|丰台|x山|h|门头沟|房山|通州|Z|昌^|大兴|q|怀柔|密云|延庆");
where[2] = new comefrom("上v","|黄|卢湾|徐汇|长宁|静安|普陀|闸北|虹口|杨|闵行|宝山|嘉定|东|金山|松江|青|南汇|奉贤|崇明");
where[3] = new comefrom("天|","|和^|东丽|河东|襉K|沌|z南|南开|北辰|沛_|武清|U挢|塘沽|汉沽|大港|宁河|静v|宝坻|蓟县");
where[4] = new comefrom("重庆","|万州|涪陵|渝中|大渡口|江北|沙坪坝|九龙坡|南岸|北碚|万盛|双挢|渝北|巴南|黔江|长寿|E江|潼南|铜梁|大|荣昌|壁山|梁^|城口|丰都|垫江|武隆|忠县|开县|云阳|奉节|巫山|巫溪|x|U山|酉阳|彭水|江||合川|永川|南川");
where[5] = new comefrom("沛_","|矛_庄|邯郸|邢台|保定|张家口|承d|廊坊|唐山|U皇岛|沧州|衡水");
where[6] = new comefrom("p","|太原|大同|x|长治|晋城|朔州|吕梁|d|晋中|临汾|q城");
where[7] = new comefrom("内蒙?,"|呼和特|包头|乌v|赤峰|gu贝尔盟|阿拉善盟|哲里木盟|兴安盟|乌兰察布盟|锡林郭勒盟|巴R淖尔盟|伊克昭盟");
where[8] = new comefrom("辽宁","|沈阳|大连|鞍山|抚顺|本溪|丹东|锦州|营口|阜新|辽阳|盘锦|铁岭|朝阳|葫芦?);
where[9] = new comefrom("吉林","|长春|吉林|四^|辽源|通化|白山|村֎|白城|延边");
where[10] = new comefrom("黑龙?,"|哈尔滨|齐齐哈尔|牡丹江|x斯|大庆|l化|鹤岗|鸡西|黑河|双鸭山|伊春|七台河|大兴安岭");
where[11] = new comefrom("江苏","|南京|镇江|苏州|南通|扬州|盐城|徐州|q云港|常州|无锡|宿迁|泰州|淮安");
where[12] = new comefrom("江","|杭州|宁L|温州|嘉兴|湖州|l兴|金华|州|舟山|台州|丽水");
where[13] = new comefrom("安徽","|合肥|芜湖|蚌埠|马鞍山|淮北|铜陵|安庆|黄山|滁州|宿州|池州|淮南|巢湖|阜阳|六安|宣城|些_");
where[14] = new comefrom("徏","|州|厦门|莆田|三明|泉州|漛_|南^|龙岩|宁d");
where[15] = new comefrom("江西","|南昌市|景d镇|九江|鹰潭|萍乡|新馀|赣州|吉安|宜春|抚州|上饶");
where[16] = new comefrom("׃","|南|青岛|淄博|枣庄|东营|烟台|潍坊|宁|泰安|威v|日照|p|临沂|德州|聊城|滨州|菏泽");
where[17] = new comefrom("沛_","|郑州|开|z阳|q顶山|安阳|鹤壁|C|焦作|Ȯ阳|许昌|漯河|三门峡|南阳|商丘|信阳|周口|驻马店|源");
where[18] = new comefrom("湖北","|武汉|宜昌|荆州|襄樊|黄石|荆门|黄冈|十堰|恩施|潜江|天门|仙桃|随州|咸宁|孝感|鄂州");
where[19] = new comefrom("湖南","|长沙|常d|株洲|湘潭|衡阳|岳阳|邵阳|益阳|娄底|怀化|郴州|永州|湘西|张家?);
where[20] = new comefrom("q东","|q州|深圳|珠v|汕头|东莞|中山|佛山|韶关|江门|湛江|茂名|肇庆|惠州|梅州|汕尾|x|x|清远|潮州|揭阳|云Q");
where[21] = new comefrom("q西","|南宁|柛_|桂林|梧州|北v|防城港|钦州|贉||玉林|南宁地区|柛_地区|贺州|百色|x");
where[22] = new comefrom("南","|口|三亚");
where[23] = new comefrom("四川","|成都|l阳|德阳|自A|攀枝花|q元|内江|乐山|南充|宜宾|q安|辑ַ|雅安|眉山|甘孜|凉山|泸州");
where[24] = new comefrom("贵州","|贵阳|六盘水|遵义|安顺|铜仁|黔西南|毕节|黔东南|黔南");
where[25] = new comefrom("云南","|昆明|大理|曲靖|玉溪|昭通|楚雄|U河|文山|思茅|西双版纳|保山|德宏|丽江|怒江|q庆|临");
where[26] = new comefrom("西藏","|拉萨|日喀则|山南|林芝|昌都|阉K|那曲");
where[27] = new comefrom("陕西","|西安|宝鸡|咔R|铜川|渭南|延安|榆林|汉中|安康|商洛");
where[28] = new comefrom("甘肃","|兰州|嘉峪关|金昌|白银|天水|酒泉|张掖|武威|定西|陇南|q_|庆阳|临夏|甘南");
where[29] = new comefrom("宁夏","|银川|矛_山|吴忠|固原");
where[30] = new comefrom("青v","|西宁|东|南|北|黄南|玉树|果洛|");
where[31] = new comefrom("新疆","|乌鲁木齐|x子|克拉玛依|伊犁|巴音郭勒|昌吉|克孜勒苏柯尔克孜|博尔塔拉|吐鲁番|哈密|喀什|和田|阿克?);
where[32] = new comefrom("香港","");
where[33] = new comefrom("澳门","");
where[34] = new comefrom("台湾","|台北|高雄|C|台南|屏东|南投|云林|新竹|彰化|苗栗|嘉义|p|桃园|宜兰|基隆|C|金门|马祖|澎湖");
where[35] = new comefrom("其它","|北美z|南美z|亚洲|非洲|Ƨ洲|大洋z?);

function select() {
with(document.creator.province) { var loca2 = options[selectedIndex].value; }
for(i = 0;i < where.length;i ++) {
if (where[i].loca == loca2) {
loca3 = (where[i].locacity).split("|");
for(j = 0;j < loca3.length;j++) { with(document.creator.city) { length = loca3.length; options[j].text = loca3[j]; options[j].value = loca3[j]; var loca4=options[selectedIndex].value;}}
break;
}}
document.creator.newlocation.value=loca2+loca4;
}

function init() {
with(document.creator.province) {
length = where.length;
for(k=0;k<where.length;k++) { options[k].text = where[k].loca; options[k].value = where[k].loca; }
options[selectedIndex].text = where[0].loca; options[selectedIndex].value = where[0].loca;
}
with(document.creator.city) {
loca3 = (where[0].locacity).split("|");
length = loca3.length;
for(l=0;l<length;l++) { options[l].text = loca3[l]; options[l].value = loca3[l]; }
options[selectedIndex].text = loca3[0]; options[selectedIndex].value = loca3[0];
}}
-->
</script>
<font color=#000000>
误入您所在国家的具体地方。此可?lt;br><br>
省䆾 <select name="province" onChange = "select()"></select> 城市 <select name="city" onChange = "select()"></select>
<br>
我在 <input type=text name="newlocation" maxlength=12 size=12 style="font-weight: bold"> 不能过12个字W(6个汉字)
</form>

]]>
JS控制的页面回退http://www.268147.live/algz/articles/333027.html紫蝶∏飛揚↗紫蝶∏飛揚↗Mon, 27 Sep 2010 02:11:00 GMThttp://www.268147.live/algz/articles/333027.htmlhttp://www.268147.live/algz/comments/333027.htmlhttp://www.268147.live/algz/articles/333027.html#Feedback0http://www.268147.live/algz/comments/commentRss/333027.htmlhttp://www.268147.live/algz/services/trackbacks/333027.html onclick="javascript:history.go(-1);"

]]>
JSP EL表达式和JSP脚本<%%> 无法在外部引用的JS文g中执?/title><link>http://www.268147.live/algz/articles/321846.html</link><dc:creator>紫蝶∏飛揚↗</dc:creator><author>紫蝶∏飛揚↗</author><pubDate>Tue, 25 May 2010 09:06:00 GMT</pubDate><guid>http://www.268147.live/algz/articles/321846.html</guid><wfw:comment>http://www.268147.live/algz/comments/321846.html</wfw:comment><comments>http://www.268147.live/algz/articles/321846.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.268147.live/algz/comments/commentRss/321846.html</wfw:commentRss><trackback:ping>http://www.268147.live/algz/services/trackbacks/321846.html</trackback:ping><description><![CDATA[如果面引用的外部JS脚本使用EL{服务端执行的代?是无法获取到值的.只有在JSP文g里的JS脚本才能取到服务端代码的?<br /> <br /> 原因Q?br /> 所有的jsp文g在响应给用户旉会编译成servletQ执行其中所有的JSP脚本或EL表达式,q由java输出{化成HTML文本代码response响应l客LQ所以浏览器接收到的只是html面。而外部js文g与HTML一起响应给客户端,q在本地l装在一P所?lt;script src="xxx.js">q样的外部引用JSQ是无法执行服务端脚本的? <img src ="http://www.268147.live/algz/aggbug/321846.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.268147.live/algz/" target="_blank">紫蝶∏飛揚↗</a> 2010-05-25 17:06 <a href="http://www.268147.live/algz/articles/321846.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JS数组元素的删?改变索引?/title><link>http://www.268147.live/algz/articles/320589.html</link><dc:creator>紫蝶∏飛揚↗</dc:creator><author>紫蝶∏飛揚↗</author><pubDate>Tue, 11 May 2010 07:02:00 GMT</pubDate><guid>http://www.268147.live/algz/articles/320589.html</guid><wfw:comment>http://www.268147.live/algz/comments/320589.html</wfw:comment><comments>http://www.268147.live/algz/articles/320589.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.268147.live/algz/comments/commentRss/320589.html</wfw:commentRss><trackback:ping>http://www.268147.live/algz/services/trackbacks/320589.html</trackback:ping><description><![CDATA[<p>function disp_alert()<br /> {<br /> var a=new Array(1,2,3,4,5,6)<br /> var b=new Array()<br /> var i=5;<br /> b=a.slice(0,i).concat(a.slice(i+1));//对i为最后一个元素或W一个元素都没问?而且i=-1为最后一个元?以此cL.</p> <p>alert("删除了第六个元素Q?+b)<br /> }<br /> </script></p> print:1,2,3,4,5 <img src ="http://www.268147.live/algz/aggbug/320589.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.268147.live/algz/" target="_blank">紫蝶∏飛揚↗</a> 2010-05-11 15:02 <a href="http://www.268147.live/algz/articles/320589.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title> JQuery 用所有select标签的?/title><link>http://www.268147.live/algz/articles/320285.html</link><dc:creator>紫蝶∏飛揚↗</dc:creator><author>紫蝶∏飛揚↗</author><pubDate>Fri, 07 May 2010 07:49:00 GMT</pubDate><guid>http://www.268147.live/algz/articles/320285.html</guid><wfw:comment>http://www.268147.live/algz/comments/320285.html</wfw:comment><comments>http://www.268147.live/algz/articles/320285.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.268147.live/algz/comments/commentRss/320285.html</wfw:commentRss><trackback:ping>http://www.268147.live/algz/services/trackbacks/320285.html</trackback:ping><description><![CDATA[只是一个知识小?有时很有?<br />  $("#changeupdate input").attr("disabled","disabled");<br />  $("#changeupdate select option").attr("disabled","disabled");<br />  <br /> <br />  $("#Auditingmodify").bind("click",function(){<br />    $("#changeupdate input").attr("disabled","");<br />  $<span style="color: #99cc00">("#changeupdate select option").</span>attr("disabled","");<br /> 很简?要选择select 然后在选择其所有子option 在禁?呵呵.一直以为直接select . <img src ="http://www.268147.live/algz/aggbug/320285.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.268147.live/algz/" target="_blank">紫蝶∏飛揚↗</a> 2010-05-07 15:49 <a href="http://www.268147.live/algz/articles/320285.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SwfUploadQ文件上传组Ӟ 使用q程中的结(以下内容只作Z人笔记记?http://www.268147.live/algz/articles/308256.html紫蝶∏飛揚↗紫蝶∏飛揚↗Tue, 05 Jan 2010 04:34:00 GMThttp://www.268147.live/algz/articles/308256.htmlhttp://www.268147.live/algz/comments/308256.htmlhttp://www.268147.live/algz/articles/308256.html#Feedback1http://www.268147.live/algz/comments/commentRss/308256.htmlhttp://www.268147.live/algz/services/trackbacks/308256.html
2.关于按钮讄成透明背景无法在FF3中显C的问题?br /> 解决ҎQSWFUploadlg必须作ؓ兄弟l点定义在所要覆盖的UIlg前?br /> <SWF文g>
<UI html文g>

3.最后发C问题.本来惌已写上传lg.研究了半?最后发现还是用现成的好.呵呵.

]]>
如何动态加载外部CSS与JS文ghttp://www.268147.live/algz/articles/307277.html紫蝶∏飛揚↗紫蝶∏飛揚↗Fri, 25 Dec 2009 07:58:00 GMThttp://www.268147.live/algz/articles/307277.htmlhttp://www.268147.live/algz/comments/307277.htmlhttp://www.268147.live/algz/articles/307277.html#Feedback0http://www.268147.live/algz/comments/commentRss/307277.htmlhttp://www.268147.live/algz/services/trackbacks/307277.html   应用Q?br />   1、提高代码的复用Q减代码量Q?br />   2、添加一个javascript控制器和 session可以实现动态改变页面样式;
  3、由于是面是从上到下依ơ加载文件的Qƈ且边加蝲边解释,所以可以添加javascript控制器控刉面文件的加蝲序Q如先加载css布局文gQ再昄有图片的css化文g,之后再加载大的falsh文gQ或者安内容的重要性来加蝲?br />
   To load a .js or .css file dynamically, in a nutshell, it means using DOM methods to first create a swanky new "script" or "LINK" element, assign it the appropriate attributes, and finally, use element.appendChild() to add the element to the desired location within the document tree. It sounds a lot more fancy than it really is. Lets see how it all comes together: 
 
  接下来的工作是绑定到<head>标签。绑定的时候有一个问题就是同一个文件有可能被我们绑定两ơ,l定两次览器也不会出现异常Q但是效率就低了。ؓ了避?br />   q种情况我们可以新增一个全局数组变量Q把l定的文件名字保存在里面Q每ơ绑定前先检查一下是否已l存在,如果存在提C已l存在,如果不存在就l定?br />
div css xhtml xml Example Source Code Example Source Code [www.52css.com]
document.getElementsByTagName("head")[0].appendChild(fileref) 

   By referencing the HEAD element of the page first and then calling appendChild(), this means the newly created element is added to the very end of the HEAD tag. Furthermore, you should be aware that no existing element is harmed in the adding of the new element- that is to say, if you call loadjscssfile("myscript.js", "js") twice, you now end up with two new "script" elements both pointing to the same Javascript file. This is problematic only from an efficiency standpoint, as you'll be adding redundant elements to the page and using unnecessary browser memory in the process. A simple way to prevent the same file from being added more than once is to keep track of the files added by loadjscssfile(), and only load a file if it's new:

div css xhtml xml Example Source Code Example Source Code [www.52css.com]
var filesadded="" //保存已经l定文g名字的数l变?nbsp;
function checkloadjscssfile(filename, filetype){ 
if (filesadded.indexOf("["+filename+"]")==-1){// indexOf判断数组里是否有某一?nbsp;
  loadjscssfile(filename, filetype) 
  filesadded+="["+filename+"]" //把文件名字添加到filesadded 

else 
  alert("file already added!")//如果已经存在提C?nbsp;

checkloadjscssfile("myscript.js", "js") //success 
checkloadjscssfile("myscript.js", "js") //redundant file, so file not added 

   Here I'm just crudely detecting to see if a file that's set to be added already exists within a list of added files' names stored in variable filesadded before deciding whether to proceed or not. 
   Ok, moving on, sometimes the situation may require that you actually remove or replace an added .js or .css file. Lets see how that's done next. 

div css xhtml xml Example Source Code Example Source Code [www.52css.com]
function loadjscssfile(filename, filetype){ 
if (filetype=="js"){ //判断文gcd 
  var fileref=document.createElement('script')//创徏标签 
  fileref.setAttribute("type","text/javascript")//定义属性type的gؓtext/javascript 
  fileref.setAttribute("src", filename)//文g的地址 

else if (filetype=="css"){ //判断文gcd 
  var fileref=document.createElement("link") 
  fileref.setAttribute("rel", "stylesheet") 
  fileref.setAttribute("type", "text/css")  
  fileref.setAttribute("href", filename) 

if (typeof fileref!="undefined") 
  document.getElementsByTagName("head")[0].appendChild(fileref) 
}  

loadjscssfile("myscript.js", "js") //打开面时浏览器动态的加蝲文g 
loadjscssfile("javascript.php", "js") // 打开面时浏览器动态的加蝲"javascript.php" Q?nbsp;
loadjscssfile("mystyle.css", "css") //打开面时浏览器动态的加蝲.css 文g 


]]>
[转]如何动态加?JavaScript ?CSShttp://www.268147.live/algz/articles/307272.html紫蝶∏飛揚↗紫蝶∏飛揚↗Fri, 25 Dec 2009 07:49:00 GMThttp://www.268147.live/algz/articles/307272.htmlhttp://www.268147.live/algz/comments/307272.htmlhttp://www.268147.live/algz/articles/307272.html#Feedback0http://www.268147.live/algz/comments/commentRss/307272.htmlhttp://www.268147.live/algz/services/trackbacks/307272.html

Omar AL Zabirq位MVPL喜欢搞些E奇古怪同时又很实用的东西,q且q十分值得参考。最q他做了一个叫?a >ensure的小工具用于动态加载JavaScript、CSS与HTMLQ而且IE、Firefox、Opera、Safari都支持了Q那么我们就来看看ensure是如何做到动态加载JavaScript与CSS的?/p>

在介lensure内部的实C前,让我们先来看看其功能Q?/p>

ensure({
    html: "popup.html",
    javascript: "popup.js",
    css: "popup.css"
  }, function() {
    Popup.show("hello world");
  }
);

在这D代码中Qensure首先会确保popup.html、popup.js、popup.cssq?个文件的加蝲Q如果都没加载过ensure ׃动态加载它们;如果已经加蝲q了Qensure不会再次加蝲。在保q?个文仉加蝲后,ensure会调用后面的匿名函数Q也是执行 Popup.show("hello world");?/p>

接下来,p我们看看ensure是如何动态加载JavaScript与CSS的?/p>

加蝲JavaScript

在ensure当中Q加载JavaScript分两U情冉|执行Q也是Safari与非Safariq两U情c?/p>

在IE、Firefox、Opera中加载JavaScript

在这三款览器中加蝲JavaScriptQ其实只需要创Z个script元素Q把src指向要加载的URLQ最后把script元素q加到head元素上,那就搞掂了。此工作是?strong>HttpLibrary.createScriptTag()中完成的。不q我们不仅仅要加载JavaScriptQ同时还需要知道它什么时候完成加载,q可以通过script元素的onload事g或onreadystatechange事g来实现?/p>

在Safari中加载JavaScript

因ؓSafari 2不支持onload或者onreadystatechangeQ所以只能手动通过XHR把URLdq来Q然后再手动evalq段代码Q这带来了一个限制──只能加蝲本域的JavaScript文g。在ensure当中Qeval的工作是通过HttpLibrary.globalEval()来完成的。ؓ了让JavaScript代码在全局QglobalQ上下文中evalQensureq是使用了创建script元素的方法,q将要eval的JavaScript|于其内Q最后把script元素q加到head元素内?/p>

l心的h肯定要问Qؓ什?strong>HttpLibrary.globalEval()要如此设计,而非直接window.eval或?strong>eval.call。这是因为,window.eval?strong>eval.call都无法在IE6中实现和script标签加蝲JavaScript代码一模一L效果Q这两种做法的eval在IE6下仍然不是在全局上下文中执行的。搜索一下你׃发现一些相关的讨论Q例如jQuery曾l?strong>window.execScript()来完成此Q务。不q最l大安发现dscript元素才是最好的跨浏览器解决ҎQ所以现在的jQuery和ensure都是如此实现的了?/p>

加蝲CSS

相对于加载JavaScript而言Q加载CSSq单多了,而且Ҏ也是cM的:在head元素内直接加入link元素可以了。这也正?strong>loadCSS()所完成的工作?/p>

实际上,ensure没有保CSS完成加蝲后再执行下去。这估计是因为浏览器都能够在CSS加蝲完成后自动应用到面上,因此Omar AL Zabirp为CSS的加载顺序是无关紧要的,不过假如CSS加蝲速度实在太慢Q其实还是会影响昄效果的?/p>

在IE6中加载CSS

q次需要特别照儡是IE6Q而非Safari。IE6在往head元素dlink元素Ӟ必须在window的上下文中完成,因此dlink的函数通过call调用切换了上下文?/p>

ȝ

实际上动态加载JavaScript与CSS都ƈ不难Q在大多数情况下只需要向head元素q加对应的子元素可以了Q只有Safari2和IE6q两Ƒ֏老的览器是需要特D照儡?/p>                                                                                转自----http://www.cnblogs.com/cathsfz/archive/2008/09/02/1282415.html



]]>javascript中的局?全局eval函数,IE/FIREFOX不同的处?/title><link>http://www.268147.live/algz/articles/307007.html</link><dc:creator>紫蝶∏飛揚↗</dc:creator><author>紫蝶∏飛揚↗</author><pubDate>Wed, 23 Dec 2009 04:09:00 GMT</pubDate><guid>http://www.268147.live/algz/articles/307007.html</guid><wfw:comment>http://www.268147.live/algz/comments/307007.html</wfw:comment><comments>http://www.268147.live/algz/articles/307007.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.268147.live/algz/comments/commentRss/307007.html</wfw:commentRss><trackback:ping>http://www.268147.live/algz/services/trackbacks/307007.html</trackback:ping><description><![CDATA[Q?Q介ljavascript中的eval函数的用?br /> Q?Q如何在函数内执行全局代码<br /> <br /> ►先来说eval的用法?br /> eval函数接收一个参数sQ如果s不是字符Ԍ则直接返回s。否则执行s语句。如果s语句执行l果是一个|则返回此|否则q回undefined?br /> 需要特别注意的是对象声明语?#8220;{}”q不能返回一个|需要用括号括v来才会返回|单示例如下:<br /> <br /> var code1='"a" + 2'; //表达?br /> var code2='{a:2}'; //语句<br /> alert(eval(code1)); //->'a2'<br /> alert(eval(code2)); //->undefined<br /> alert(eval('(' + code2 + ')')); //->[object Object]<br /> 可以看到Q对于对象声明语句来_仅仅是执行,q不能返回倹{ؓ了返回常用的“{}”q样的对象声明语句,必须用括h住,以将其{换ؓ表达式,才能q回其倹{这也是使用JSON来进行Ajax开发的基本原理之一?br /> <br /> ►如何在函数内执行全局代码。ؓ了说明这个问题,先看一个例子:<br /> <br /> var s='global'; //定义一个全局变量<br /> function demo1(){<br /> eval('var s="local"');<br /> }<br /> demo1();<br /> alert(s); //->global<br /> 很好理解Q上面的demo1函数{h于:function demo1(){var s='local';}Q其中定义了一个局部变量s?br /> 所以最后的输出是globalq不是什么奇怪的事情Q毕竟大安能很清楚的区分局部变量和全局变量?br /> 仔细体会一下,可以发现eval函数的特点,它L在调用它的上下文变量I间Q也UCؓQ包QclosureQ内执行Q无论是变量定义q是函数定义都是如此Q所以如下的代码会生函数未定义的错误:<br /> <br /> var s='function test(){return 1;}'; //一个函数定义语?br /> function demo2(){<br /> eval(s);<br /> }<br /> demo2();<br /> alert(test()); //->error:test is not defined<br /> q是因ؓtest函数在局部空间定义,demo2函数内可以访问到Q外面就讉K不到了?br /> <br /> 而在实际的Ajax开发中Q有时我们需要从服务器动态获取代码来执行Q以减轻一ơ蝲入代码过多的问题Q或者是一些代码是通过Javascript自n生成的,希望用eval函数来其执行?br /> 但这L动态获取代码的工作一般在函数内完成,比如Q?br /> <br /> <span style="color: #008000">function loadCode(){<br /> var code=getCode();   //可通过AJAXh获得<br /> eval(code);                  //加蝲JS{文?<br /> }<br /> </span><br /> 可见<span style="color: #339966">eval不可能在全局I间内执?/span>Q这q开发带来了不少问题?br /> <br /> 不过现在可以同时兼容IE和FirefoxQ方法如下:<br /> <br /> var X2={} //my namespace:)<br /> X2.Eval=function(code){<br /> <span style="color: #008000">if(!!(window.attachEvent && !window.opera)){  //览器识?br /> <span style="color: #808000">//ie<br /> execScript(code); </span><br /> }else{<br /> <span style="color: #99cc00">//not ie<br /> window.eval(code);</span><br /> }</span><br /> }<br /> 现在如果要想在函数内定义全局代码Q就可以通过调用X2.Eval(code)ҎQ一个例子如下:<br /> <br /> var s='global';<br /> function demo3(){<br /> X2.Eval('var s="local"');<br /> }<br /> demo3();<br /> alert(s); //->'local'<br /> 可见Q在demo3函数内重新定义了全局变量s="local"?br /> 需要注意的是X2.Evalq不q回|如果要进行表辑ּ的求|q是用系l的eval函数。X2.Eval设计Z做全局代码定义用?br /> <br /> Q?Q对于IE览器,默认已经提供了这L函数QexecScriptQ用于在全局I间执行代码Q只是知道的不多?br /> Q?Q对于Firefox览器,直接调用eval函数Q则在调用者的I间执行Q如果调用window.eval则在全局I间执行?br /> <br /> Firefox的eval函数的特点的是很o人奇怪的Q但从javascript规范中倒也能找到其来源Q?br /> <br /> If value of the eval property is used in any way other than a direct call (that is, other than by the explicit use of its<br /> name as an Identifier which is the MemberExpression in a CallExpression), or if the eval property is assigned to,<br /> an EvalError exception may be thrown.<br /> 意思大概就是说eval函数的执行是和调用者相关的Q但q没有说其执行上下文的问题。所以IE和Firefox孰是孰非也就很难说了Q大家知道解军_法就好?br /> <img src ="http://www.268147.live/algz/aggbug/307007.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.268147.live/algz/" target="_blank">紫蝶∏飛揚↗</a> 2009-12-23 12:09 <a href="http://www.268147.live/algz/articles/307007.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>DIV+CSS 表格讄及图C?/title><link>http://www.268147.live/algz/articles/298591.html</link><dc:creator>紫蝶∏飛揚↗</dc:creator><author>紫蝶∏飛揚↗</author><pubDate>Fri, 16 Oct 2009 07:56:00 GMT</pubDate><guid>http://www.268147.live/algz/articles/298591.html</guid><wfw:comment>http://www.268147.live/algz/comments/298591.html</wfw:comment><comments>http://www.268147.live/algz/articles/298591.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.268147.live/algz/comments/commentRss/298591.html</wfw:commentRss><trackback:ping>http://www.268147.live/algz/services/trackbacks/298591.html</trackback:ping><description><![CDATA[<pre> <pre>以下为浏览器firefox,ie默认讄Q?/pre> <pre>table { display: table; <span style="color: #339966">border-spacing: 2px; /*border-spacing 属性设|相d元格的边框间的距(仅用?#8220;Ҏ分离”模式Q。在指定的两个长度gQ第一个是水^间隔Q第二个是垂直间隔?/<br /> </span>border-collapse: separate; /* 除非 border-collapse 被设|ؓ separateQ否则将忽略q个属性?*/ margin-top: 0; margin-bottom: 0; text-indent: 0; }</pre> td {display:table-cell;<span style="color: #339966">padding:1px;</span>text-align:inherit;vertical-align:inherit;}  </pre> <font face="Courier New">*****************************************<br /> <td <span style="color: #339966">colspan</span>="<em>value</em>"> Q设|单元格可横跨的列数?span style="color: #339966">rowspan</span>:横跨的行数。spanQ跨度,两个界限之间的距R?br /> *****************************************<br />     <table border="1">                    <span style="color: #339966">/* DW面设计中显C正?*/</span><br />       <tr><br />       <td  width="26">td</td><br />       <td  width="139">td</td><br />       <td  width="60">td</td><br />       </tr><br />     </table><br />         <table border="1">               <span style="color: #339966">/* DW面设计中显CZ正常 */</span><br />       <tr><br />       <td style="width:26px;" >s</td><br />       <td style="width:139px;" >s</td><br />       <td style="width:60px;">s</td><br />       </tr><br />     </table>                     <span style="color: #339966">/* DW面设计中显CZ正常Q推荐用,节约代码 */</span><br />         </table><br />         <table border="1"><br />       <colgroup><br />       <col width="26" /><br />       <col width="139" /><br />       <col width="60" /><br />       </colgroup><br />       <tr><br />       <td >c</td><br />       <td >c</td><br />       <td >c</td><br />       </tr><br />     </table><br /> </font> <img border="0" alt="" src="http://www.268147.live/images/blogjava_net/algz/table.png" width="255" height="116" /> <img src ="http://www.268147.live/algz/aggbug/298591.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.268147.live/algz/" target="_blank">紫蝶∏飛揚↗</a> 2009-10-16 15:56 <a href="http://www.268147.live/algz/articles/298591.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>firefox IE 览器,元素标签边距默认?/title><link>http://www.268147.live/algz/articles/298556.html</link><dc:creator>紫蝶∏飛揚↗</dc:creator><author>紫蝶∏飛揚↗</author><pubDate>Fri, 16 Oct 2009 05:28:00 GMT</pubDate><guid>http://www.268147.live/algz/articles/298556.html</guid><wfw:comment>http://www.268147.live/algz/comments/298556.html</wfw:comment><comments>http://www.268147.live/algz/articles/298556.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.268147.live/algz/comments/commentRss/298556.html</wfw:commentRss><trackback:ping>http://www.268147.live/algz/services/trackbacks/298556.html</trackback:ping><description><![CDATA[<pre>h1 { display: block; font-size: 2em; font-weight: bold; <span style="color: #008000">margin: .67em 0;</span>} h2 { display: block; font-size: 1.5em; font-weight: bold; <span style="color: #008000">margin: .83em 0</span>; } h3 { display: block; font-size: 1.17em; font-weight: bold; <span style="color: #008000">margin: 1em 0;</span>} h4 { display: block; font-weight: bold; <span style="color: #008000">margin: 1.33em 0;</span>} h5 { display: block; font-size: 0.83em; font-weight: bold; <span style="color: #008000">margin: 1.67em 0;</span>}</pre> <pre>h6 {display: block;font-size: 0.67em;font-weight: bold;<span style="color: #008000">margin: 2.33em 0;</span>}</pre> <pre> <pre><font face="Courier New">*************************************************************************************</font> table { display: table; <span style="color: #339966">border-spacing: 2px; /*border-spacing 属性设|相d元格的边框间的距(仅用?#8220;Ҏ分离”模式Q。在指定的两个长度gQ第一个是水^间隔Q第二个是垂直间隔?/<br /> </span>border-collapse: separate; /* 除非 border-collapse 被设|ؓ separateQ否则将忽略q个属性?*/ margin-top: 0; margin-bottom: 0; text-indent: 0; }</pre> td {display:table-cell;<span style="color: #339966">padding:1px;</span>text-align:inherit;vertical-align:inherit;}  </pre> <font face="Courier New"><br />     <table border="1">                    <span style="color: #339966">/* DW面设计中显C正?*/</span><br />       <tr><br />       <td  width="26">td</td><br />       <td  width="139">td</td><br />       <td  width="60">td</td><br />       </tr><br />     </table><br />         <table border="1">               <span style="color: #339966">/* DW面设计中显CZ正常 */</span><br />       <tr><br />       <td style="width:26px;" >s</td><br />       <td style="width:139px;" >s</td><br />       <td style="width:60px;">s</td><br />       </tr><br />     </table>                     <span style="color: #339966">/* DW面设计中显CZ正常Q推荐用,节约代码 */</span><br />         </table><br />         <table border="1"><br />       <colgroup><br />       <col width="26" /><br />       <col width="139" /><br />       <col width="60" /><br />       </colgroup><br />       <tr><br />       <td >c</td><br />       <td >c</td><br />       <td >c</td><br />       </tr><br />     </table><br /> </font> <img border="0" alt="" src="http://www.268147.live/images/blogjava_net/algz/table.png" width="255" height="116" /><br /> <td colspan="<em>value</em>"> Q设|单元格可横跨的列数。rowspan:横跨的行数。spanQ跨度,两个界限之间的距R?br /> ******************************************************************** <pre> firefox ie 览器默认?1em=16px)<br /> </pre> <p>Q?Q?br /> <img border="0" alt="" src="http://www.268147.live/images/blogjava_net/algz/dl.png" /><br /> ul{padding-left:40px;margin:1em 0;}   <span style="color: #339966">/* ul 标签上下外间距ؓ16px;左内间距?0px; */<br /> </span>p,dl{margin:1em 0;}                           <span style="color: #339966">/* p,dl 标签上下外间距ؓ16px; */<br /> </span>dd{margin-left:40px;}                         <span style="color: #339966">/* dd 标签左外间距?0px; */</span><br /> firefox: ul dl,dl ul,.....{margin-top:0;margin-bottom:0;} <span style="color: #339966">/* 列表嵌套QIE中列表嵌套不讄此属性,依然是margin:1em 0; */ </span>  </p> <p><ul>Q?lt;dl> 列表标签一般不讄背景囄{样式,只设|margin,padding边距属性,样式属性只?lt;li>Q?lt;dt>Q?lt;dd>{设|?br /> 表格里的<td>内部不需在添加块框,x加背景只接用<td>样式卛_?br /> <br /> 2QIE中Q何元素最高度规定ؓ19pxQ不可更攏V解x法:讄高度?9px以下的元素需指定overflow:hidden属性,间接的解决问题?<br /> <br /> 3) IE7?<li> 最低高度ؓ19px.</p> <img src ="http://www.268147.live/algz/aggbug/298556.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.268147.live/algz/" target="_blank">紫蝶∏飛揚↗</a> 2009-10-16 13:28 <a href="http://www.268147.live/algz/articles/298556.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>元素垂直居中CSS解决Ҏhttp://www.268147.live/algz/articles/298406.html紫蝶∏飛揚↗紫蝶∏飛揚↗Thu, 15 Oct 2009 08:05:00 GMThttp://www.268147.live/algz/articles/298406.htmlhttp://www.268147.live/algz/comments/298406.htmlhttp://www.268147.live/algz/articles/298406.html#Feedback0http://www.268147.live/algz/comments/commentRss/298406.htmlhttp://www.268147.live/algz/services/trackbacks/298406.html    <p><img /></p>
</div>

一 div昄格框 (本h未测试通过)
div{display:table-cell;   /* 也可为table{?*/
      vertical:middle;       /* 只有firefox在去掉以上属性时Q支持此属?*/
     }
?采用l对地址和外边距居中 Q推?不用看也可以通过Q?br /> div{position:relative;    /* 可无需讄left{,此属性主要是为内部标{p定位 */
      height:xxpx;
     }
p{position:absolute;
    margin-top:Q?自n高度/2);
   }

?定义p{inline-block;.....}框来填充img的上面距d现居中。代码略?未测?

?元素内元素垂直居?nbsp; Q定位不是十分精,差别不大Q好像只适用于单行。测试通过Q?br /> div{line-height:500px;    /* line-height与height相同 */
      height:500px;
}

]]>
产品单项列表展示 DIV+CSS代码囄http://www.268147.live/algz/articles/298379.html紫蝶∏飛揚↗紫蝶∏飛揚↗Thu, 15 Oct 2009 06:01:00 GMThttp://www.268147.live/algz/articles/298379.htmlhttp://www.268147.live/algz/comments/298379.htmlhttp://www.268147.live/algz/articles/298379.html#Feedback0http://www.268147.live/algz/comments/commentRss/298379.htmlhttp://www.268147.live/algz/services/trackbacks/298379.html 
采用了列表Q动,文字环绕方式?

]]>
U?CSS 制作圆角框的实现http://www.268147.live/algz/articles/298336.html紫蝶∏飛揚↗紫蝶∏飛揚↗Thu, 15 Oct 2009 02:51:00 GMThttp://www.268147.live/algz/articles/298336.htmlhttp://www.268147.live/algz/comments/298336.htmlhttp://www.268147.live/algz/articles/298336.html#Feedback0http://www.268147.live/algz/comments/commentRss/298336.htmlhttp://www.268147.live/algz/services/trackbacks/298336.html<html>
<head>
<style>
#a{
border-left:1px #333 solid;
border-right:1px #333 solid;
width:300px;
height:500px;
}
.b{
height:1px;
overflow:hidden;        /* 兼容IE,因ؓIE指定M元素最高度都?9pxQ不可更攏V?/
border-left:1px #333 solid;
border-right:1px #333 solid;
}
</style>
</head>
<body>
<div>
<div class="b" style="margin-left:3px;width:294px;background:#333"></div>
<div class="b" style="margin-left:2px;width:296px;"></div>
<div class="b" style="margin-left:1px;width:298px"></div>
<div id="a">

代码很简单,a层ؓ内容层,其width?00Q然?span style="color: #008000">用b层向外以左右Ҏ2像素Q可LQ的宽度递减?/span>最外一层要加上background属性,目的是要上、下两线条呈现出来;b层的数量军_了要实现的圆角弧度大。在firefox IE6 都通过试?br />
</div>
<div class="b" style="margin-left:1px;width:298px"></div>
<div class="b" style="margin-left:2px;width:296px;"></div>
<div class="b" style="margin-left:3px;width:294px;background:#333"></div>
</div>
</body>
</html>



]]>
产品横行览 DIV+CSS 布局代码囄http://www.268147.live/algz/articles/298210.html紫蝶∏飛揚↗紫蝶∏飛揚↗Wed, 14 Oct 2009 06:51:00 GMThttp://www.268147.live/algz/articles/298210.htmlhttp://www.268147.live/algz/comments/298210.htmlhttp://www.268147.live/algz/articles/298210.html#Feedback0http://www.268147.live/algz/comments/commentRss/298210.htmlhttp://www.268147.live/algz/services/trackbacks/298210.html

]]>
3 2019Ů ʳɵ˻ ر ʮһѡɱ׼ȷ90 Ʊֻ ʮһѡ忪ʷ ũƱվ pkʰ ֵ֮֮¼ƽ Ʊǵʲôй