??xml version="1.0" encoding="utf-8" standalone="yes"?>国语自产精品视频在线看8查询8,欧美日韩国产一二,麻豆传媒免费在线观看http://www.aygfsteel.com/zhaochengming/category/24905.html 知止而后有定Q定而后能静Q静而后能安Q安而后能虑Q虑而后能得。物有本末,事有l始。知所先后Q则q道矣?/description>zh-cnSat, 23 Feb 2013 02:26:13 GMTSat, 23 Feb 2013 02:26:13 GMT60Console命o详解,让调试js代码变得更简?/title><link>http://www.aygfsteel.com/zhaochengming/archive/2013/02/22/395606.html</link><dc:creator>helloworld2008</dc:creator><author>helloworld2008</author><pubDate>Fri, 22 Feb 2013 11:40:00 GMT</pubDate><guid>http://www.aygfsteel.com/zhaochengming/archive/2013/02/22/395606.html</guid><wfw:comment>http://www.aygfsteel.com/zhaochengming/comments/395606.html</wfw:comment><comments>http://www.aygfsteel.com/zhaochengming/archive/2013/02/22/395606.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/zhaochengming/comments/commentRss/395606.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/zhaochengming/services/trackbacks/395606.html</trackback:ping><description><![CDATA[<div id="wmqeeuq" class="asset-body" style="margin: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;"><a target="_blank" style="color: #1a356e; text-decoration: initial;">Firebug</a>是网开发的利器Q能够极大地提升工作效率?br /></p></div><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">但是Q它不太Ҏ上手。我曄译q一?a target="_blank" style="color: #1a356e; text-decoration: initial;">《Firebug入门指南?/a>Q介l了一些基本用法。今天,l箋介绍它的高用法?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">===================================</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><strong>Firebug控制台详?/strong></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">作者:阮一?br />出处Qhttp://www.ruanyifeng.com/blog/2011/03/firebug_console_tutorial.html</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><img src="http://image.beekka.com/blog/201103/bg2011032616.png" alt="" style="border: 0px;" /></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><br />控制収ͼConsoleQ是Firebug的第一个面板,也是最重要的面板,主要作用是显C网加载过E中产生各类信息?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><strong>一、显CZ息的命o</strong></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">Firebug内置一个console对象Q提?U方法,用来昄信息?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">最单的Ҏ是console.log()Q可以用来取代alert()或document.write()。比如,在网脚本中使用console.log("Hello World")Q加载时控制台就会自动显C如下内宏V?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><img src="http://image.beekka.com/blog/201103/bg2011032601.png" alt="" style="border: 0px;" /></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">另外Q根据信息的不同性质Qconsole对象q有4U显CZ息的ҎQ分别是一般信息console.info()、除错信息console.debug()、警告提Cconsole.warn()、错误提Cconsole.error()?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">比如Q在|页脚本中插入下面四行:</p><blockquote style="background-color: #ffffff; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px;"><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  console.info("q是info");</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  console.debug("q是debug");</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  console.warn("q是warn");</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  console.error("q是error");</p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">加蝲Ӟ控制C昄如下内容?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><img src="http://image.beekka.com/blog/201103/bg2011032602.png" alt="" style="border: 0px;" /></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">可以看到Q不同性质的信息前面有不同的图标,q且每条信息后面都有链接Q点d跌{到网|码的相应行?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><strong>二、占位符</strong></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">console对象的上?U方法,都可以用printf风格的占位符。不q,占位W的U类比较,只支持字W(%sQ、整敎ͼ%d?iQ、QҎQ?fQ和对象Q?oQ四U?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">比如Q?/p><blockquote style="background-color: #ffffff; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px;"><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  console.log("%dq?d?d?,2011,3,26);</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  console.log("圆周率是%f",3.1415926);</p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><img src="http://image.beekka.com/blog/201103/bg2011032603.png" alt="" style="border: 0px;" /></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">%o占位W,可以用来查看一个对象内部情c比如,有这样一个对象:</p><blockquote style="background-color: #ffffff; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px;"><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  var dog = {} ;</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  dog.name = "大毛" ;</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  dog.color = "黄色";</p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">然后Q对它用o%占位W?/p><blockquote style="background-color: #ffffff; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px;"><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  console.log("%o",dog);</p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><img src="http://image.beekka.com/blog/201103/bg2011032604.png" alt="" style="border: 0px;" /></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><strong>三、分l显C?/strong></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">如果信息太多Q可以分l显C,用到的方法是console.group()和console.groupEnd()?/p><blockquote style="background-color: #ffffff; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px;"><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  console.group("W一l信?);</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">    console.log("W一l第一?);</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">    console.log("W一l第二条");</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  console.groupEnd();</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  console.group("W二l信?);</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">    console.log("W二l第一?);</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">    console.log("W二l第二条");</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  console.groupEnd();</p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><img src="http://image.beekka.com/blog/201103/bg2011032605.png" alt="" style="border: 0px;" /></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">点击l标题,该组信息会折叠或展开?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><img src="http://image.beekka.com/blog/201103/bg2011032606.png" alt="" style="border: 0px;" /></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><strong>四、console.dir()</strong></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">console.dir()可以昄一个对象所有的属性和Ҏ?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">比如Q现在ؓW二节的dog对象Q添加一个bark()Ҏ?/p><blockquote style="background-color: #ffffff; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px;"><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  dog.bark = function(){alert("汪汪?);};</p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">然后Q显C对象的内容,</p><blockquote style="background-color: #ffffff; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px;"><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  console.dir(dog);</p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><img src="http://image.beekka.com/blog/201103/bg2011032607.png" alt="" style="border: 0px;" /></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><strong>五、console.dirxml()</strong></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">console.dirxml()用来昄|页的某个节点(nodeQ所包含的html/xml代码?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">比如Q先获取一个表D点,</p><blockquote style="background-color: #ffffff; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px;"><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  var table = document.getElementById("table1");</p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">然后Q显C节点包含的代码?/p><blockquote style="background-color: #ffffff; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px;"><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  console.dirxml(table);</p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><img src="http://image.beekka.com/blog/201103/bg2011032608.png" alt="" style="border: 0px;" /></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><strong>六、console.assert()</strong></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">console.assert()用来判断一个表辑ּ或变量是否ؓ真。如果结果ؓ否,则在控制台输Z条相应信息,q且抛出一个异常?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">比如Q下面两个判断的l果都ؓ否?/p><blockquote style="background-color: #ffffff; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px;"><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  var result = 0;</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  console.assert( result );</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  var year = 2000;</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  console.assert(year == 2011 );</p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><img src="http://image.beekka.com/blog/201103/bg2011032609.png" alt="" style="border: 0px;" /></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><strong>七、console.trace()</strong></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">console.trace()用来q踪函数的调用轨qV?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">比如Q有一个加法器函数?/p><blockquote style="background-color: #ffffff; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px;"><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  function add(a,b){</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">    return a+b;</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  }</p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">我想知道q个函数是如何被调用的,在其中加入console.trace()Ҏ可以了?/p><blockquote style="background-color: #ffffff; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px;"><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  function add(a,b){</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">    console.trace();</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">    return a+b;</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  }</p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">假定q个函数的调用代码如下:</p><blockquote style="background-color: #ffffff; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px;"><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  var x = add3(1,1);</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  function add3(a,b){return add2(a,b);}</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  function add2(a,b){return add1(a,b);}</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  function add1(a,b){return add(a,b);}</p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">q行后,会显Cadd()的调用轨q,从上C依次为add()、add1()、add2()、add3()?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><img src="http://image.beekka.com/blog/201103/bg2011032610.png" alt="" style="border: 0px;" /></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><strong>八、计时功?/strong></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">console.time()和console.timeEnd()Q用来显CZ码的q行旉?/p><blockquote style="background-color: #ffffff; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px;"><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  console.time("计时器一");</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  for(var i=0;i<1000;i++){</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">    for(var j=0;j<1000;j++){}</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  }</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  console.timeEnd("计时器一");</p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><img src="http://image.beekka.com/blog/201103/bg2011032611.png" alt="" style="border: 0px;" /></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><strong>九、性能分析</strong></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">性能分析QProfilerQ就是分析程序各个部分的q行旉Q找出瓶颈所在,使用的方法是console.profile()?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">假定有一个函数Foo()Q里面调用了另外两个函数funcA()和funcB()Q其中funcA()调用10ơ,funcB()调用1ơ?/p><blockquote style="background-color: #ffffff; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px;"><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  function Foo(){</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">    for(var i=0;i<10;i++){funcA(1000);}</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">    funcB(10000);</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  }</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  function funcA(count){</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">    for(var i=0;i<count;i++){}</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  }</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  function funcB(count){</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">    for(var i=0;i<count;i++){}</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  }</p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">然后Q就可以分析Foo()的运行性能了?/p><blockquote style="background-color: #ffffff; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px;"><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  console.profile('性能分析器一');</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  Foo();</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">  console.profileEnd();</p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">控制C昄一张性能分析表,如下图?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><img src="http://image.beekka.com/blog/201103/bg2011032612.png" alt="" style="border: 0px;" /></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">标题栏提C,一p行了12个函敎ͼp时2.656毫秒。其中funcA()q行10ơ,耗时1.391毫秒Q最短运行时?.123毫秒Q最?.284毫秒Q^?.139毫秒QfuncB()q行1ơ,耗时1.229ms毫秒?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">除了使用console.profile()ҎQfirebugq提供了一?概况"QProfilerQ按钮。第一ơ点击该按钮Q?性能分析" 开始,你可以对|页q行某种操作Q比如ajax操作Q,然后W二ơ点击该按钮Q?性能分析"l束Q该操作引发的所有运就会进行性能分析?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><img src="http://image.beekka.com/blog/201103/bg2011032613.png" alt="" style="border: 0px;" /></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><strong>十、属性菜?/strong></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">控制台面板的名称后面Q有一个倒三角,点击后会昄属性菜单?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><img src="http://image.beekka.com/blog/201103/bg2011032614.png" alt="" style="border: 0px;" /></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">默认情况下,控制台只昄Javascript错误。如果选中Javascript警告、CSS错误、XML错误都送上Q则相关的提CZ息都会显C?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">q里比较有用的是"昄XMLHttpRequests"Q也是昄ajaxh。选中以后Q网늚所有ajaxhQ都会在控制台面板显C出来?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">比如Q点M?a target="_blank" style="color: #1a356e; text-decoration: initial;">YUICZ</a>Q控制台׃告诉我们Q它用ajax方式发出了一个GEThQhttph和响应的头信息和内容MQ也都可以看到?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><img src="http://image.beekka.com/blog/201103/bg2011032615.png" alt="" style="border: 0px;" /></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;"><strong>[参考文献]</strong></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">* <a target="_blank" style="color: #1a356e; text-decoration: initial;">Firebug Tutorial - Logging, Profiling and CommandLine (Part I)</a></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">* <a target="_blank" style="color: #1a356e; text-decoration: initial;">Firebug Tutorial - Logging, Profiling and CommandLine (Part II)</a></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, arial, 宋体; font-size: 13px; line-height: 25px; background-color: #ffffff;">Q完Q?/p><img src ="http://www.aygfsteel.com/zhaochengming/aggbug/395606.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/zhaochengming/" target="_blank">helloworld2008</a> 2013-02-22 19:40 <a href="http://www.aygfsteel.com/zhaochengming/archive/2013/02/22/395606.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>在Extjs4应用中用Ext.Loaderhttp://www.aygfsteel.com/zhaochengming/archive/2011/07/28/355233.htmlhelloworld2008helloworld2008Thu, 28 Jul 2011 07:46:00 GMThttp://www.aygfsteel.com/zhaochengming/archive/2011/07/28/355233.htmlhttp://www.aygfsteel.com/zhaochengming/comments/355233.htmlhttp://www.aygfsteel.com/zhaochengming/archive/2011/07/28/355233.html#Feedback1http://www.aygfsteel.com/zhaochengming/comments/commentRss/355233.htmlhttp://www.aygfsteel.com/zhaochengming/services/trackbacks/355233.html

在EXTJS官网看到一片文章,讲的是Extjs.Loader的用方法,文章非常详细的介l了 Loader的机制及用法Q感觉非怸错,但无奈英文实在太烂,没转过来。昨天恰好在CSDN看到了这文章的译文Q而译文的质量非常高,对译者的译 水^怎一个M慕了得。废话不多说Q正文开始?/p>

在开始之前,英文原文链接放上来Q英文水q高的可以看看原文哦?/p>

链接地址Q?a target="_blank" >www.sencha.com/blog/using-ext-loader-for-your-application/

ExtJS 4.0是一个用新的依赖系l的cd载系l。这两个强大的新功能允许你创建大量允许浏览器按需下蝲脚本代码的应用?/p>

今天Q我们将通过建立一个小的用新的类加蝲pȝ的应用程序来熟悉一下依赖管理系l。同Ӟ我们讨论Ext加蝲pȝ的各U配|项?/p>

在开始之前,我们先来看看要实现的结果。这样做Q可使我们确定需要扩展那些类?/p>

001

应用会包括互相绑定的GridPanel和FormPanelQ名U分别ؓUserGridPanel和UserFormPanel?UserGridPanel的操作需要创Z个模型和Store。UserGridPanel和UserFormPanel被渲染C个名UCؓ UserEditorWindow的窗口,它扩张自ExtJS的WindowcR所有这些类都会在命名空间MyApp下?/p>

在开始编码前Q首先要定目录l构Q以下是使用命名I间l织的文件夹Q?/p>

002

从上囑֏以看刎ͼMyApp目录已经按照命名I间q拆分成几个目录。在完成开发的时候,我们的应用将会有一个如下图所C的内部依赖q行模型?/p>

Q?span style="font-family: 宋体; color: #ff0000">管应用的目录构成很象ExtJS 4 MVC架构Q事实上CZq没有用它 Q?/p>

003

现在开始编写index.html文gQ这里需要包含应用需要的启动文g和应用的Ҏ?app.js)?/p>

 
  1. <!DOCTYPE HTML PUBLIC  "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3. <head>
  4.     <title>Ext 4 Loader</title>
  5.     <link rel="stylesheet" type="text/css"  href="js/ext-4.0.1/resources/css/ext-all.css" />
  6.     <script type="text/javascript" src="js/ext-4.0.1/ext-debug.js"></script>
  7.     <script type="text/javascript" src="js/MyApp/app.js"></script>
  8. </head>
  9. <body>
  10. </body>
  11. </html>

index.html文g中需要用link标记包含ExtJS 4的样式文件。包含ext-debug.js文g的javascript标记可能要修改多ơ,ext-all-debug.js文g是开发调试用的,而ext-all.js则是在发布品时使用的?/p>

q里有几个选择Q每个选择都有优缺炏V?/p>

以下是这些文件的说明Q?/p>

ext-all-debug-w-comments.jsQ带注释的的完整调试版本。文件比较大Q加载时间比较长?/p>

ext-all-debug.js : 不带注释的完整调试版本。文件也比较大,但很适合调试?/p>

ext-all.js Q压~后的完整版本,文g比较。用该版本调试很困难,因此一般在发布产品时才使用?/p>

ext-debug.js Q?该文件只包含ExtJS基础架构和空的结构。用该文gQ可以实现ExtJScL件的q程加蝲Q而且提供了很好的调试体验Q不q代h相当的慢?/p>

ext.js : ext-debug.js的压~版本?/p>

我们的index.html用ext-debug.js文gQ这是实现动态加载所需的最低要求。最后,我们展C如何用ext-all版本获取最好的l果?/p>

׃UserGridPanel c要求模型和StoreQ因而,要先定义~写q些支持cR现在开始编写模型和StoreQ?/p>

 
  1. Ext.define('MyApp.models.UserModel', {
  2.     extend   : 'Ext.data.Model',
  3.     fields   : [
  4.         'firstName',
  5.         'lastName',
  6.         'dob',
  7.         'userName'
  8.     ]
  9. });

以上代码扩展自Ext.data.ModelQ将创徏UserModel cR因为扩展自Ext.data.Modelc,ExtJS会自动加载它Qƈ在它加蝲后创建UserModelcR?/p>

下一步,要创建扩展自Ext.data.Store的UserStore c:

 
  1. Ext.define('MyApp.stores.UserStore', {
  2.     extend    : 'Ext.data.Store',
  3.     singleton : true,
  4.     requires  : ['MyApp.models.UserModel'],
  5.     model     : 'MyApp.models.UserModel',
  6.     constructor : function() {
  7.         this.callParent(arguments);
  8.         this.loadData([
  9.             {
  10.                 firstName : 'Louis',
  11.                 lastName  : 'Dobbs',
  12.                 dob       : '12/21/34',
  13.                 userName  : 'ldobbs'
  14.             },
  15.             {
  16.                 firstName : 'Sam',
  17.                 lastName  : 'Hart',
  18.                 dob       : '03/23/54',
  19.                 userName  : 'shart'
  20.             },
  21.             {
  22.                 firstName : 'Nancy',
  23.                 lastName  : 'Garcia',
  24.                 dob       : '01/18/24',
  25.                 userName  : 'ngarcia'
  26.             }
  27.         ]);
  28.     }
  29. });

当创建单件模式的UserStore Ӟ需要在UserStore原型d一个requires关键字,它会在类实例化前QؓExtJS提供一个类的请求列表。在q个CZQ列表中只有UserModel 一个请求类?/p>

Q实际上Q?在Store的原型中定义了model为UserModel c,ExtJS׃自动加蝲它。在requires关键字中列出的目的,是希望你的代码能自文档化Qself-documentingQ,从而提醒你QUserModel cL必须?Q?/p>

好了QUserGridPanel视图需要的基类已经创徏了,现在可以创徏UserGridPanelcMQ?/p>

 
  1. Ext.define('MyApp.views.UsersGridPanel', {
  2.     extend   : 'Ext.grid.Panel',
  3.     alias    : 'widget.UsersGridPanel',
  4.     requires : ['MyApp.stores.UserStore'],
  5.     initComponent : function() {
  6.         this.store   = MyApp.stores.UserStore;
  7.         this.columns = this.buildColumns();
  8.         this.callParent();
  9.     },
  10.     buildColumns : function() {
  11.         return [
  12.             {
  13.                 header    : 'First Name',
  14.                 dataIndex : 'firstName',
  15.                 width     : 70
  16.             },
  17.             {
  18.                 header    : 'Last Name',
  19.                 dataIndex : 'lastName',
  20.                 width     : 70
  21.             },
  22.             {
  23.                 header    : 'DOB',
  24.                 dataIndex : 'dob',
  25.                 width     : 70
  26.             },
  27.             {
  28.                 header    : 'Login',
  29.                 dataIndex : 'userName',
  30.                 width     : 70
  31.             }
  32.         ];
  33.     }
  34. });

在上面代码中Q要注意requires 关键字,看它是怎么增加UserStore 求类的。刚才,我们为GridPanel扩展和Store扩展配置了一个直接的依赖关系?/p>

下一步,我们要创建FormPanel扩展Q?/p>

 
  1. Ext.define('MyApp.views.UserFormPanel', {
  2.     extend      : 'Ext.form.Panel',
  3.     alias       : 'widget.UserFormPanel',
  4.     bodyStyle   : 'padding: 10px; background-color: #DCE5F0;' 
  5.             + ' border-left: none;',
  6.     defaultType : 'textfield',
  7.     defaults    : {
  8.         anchor     : '-10',
  9.         labelWidth : 70
  10.     },
  11.     initComponent : function() {
  12.         this.items = this.buildItems();
  13.         this.callParent();
  14.     },
  15.     buildItems : function() {
  16.         return [
  17.             {
  18.                 fieldLabel : 'First Name',
  19.                 name       : 'firstName'
  20.             },
  21.             {
  22.                 fieldLabel : 'Last Name',
  23.                 name       : 'lastName'
  24.             },
  25.             {
  26.                 fieldLabel : 'DOB',
  27.                 name       : 'dob'
  28.             },
  29.             {
  30.                 fieldLabel : 'User Name',
  31.                 name       : 'userName'
  32.             }
  33.         ];
  34.     }
  35. });

因ؓUserForm 不需要从服务器端hMc,因而不需要添加requires定义?/p>

应用快完成了Q现在需要创建UserEditorWindowcdq行应用的app.js。以下是UserEditorWindowcȝ代码。因Grid和表单绑定在一P因而类代码有点长,误谅:

 
  1. Ext.define('MyApp.views.UserEditorWindow', {
  2.     extend   : 'Ext.Window',
  3.     requires : ['MyApp.views.UsersGridPanel','MyApp.views.UserFormPanel'],
  4.     height : 200,
  5.     width  : 550,
  6.     border : false,
  7.     layout : {
  8.         type  : 'hbox',
  9.         align : 'stretch'
  10.     },
  11.     initComponent : function() {
  12.         this.items   = this.buildItems();
  13.         this.buttons = this.buildButtons();
  14.         this.callParent();
  15.         this.on('afterrender', this.onAfterRenderLoadForm, this);
  16.     },
  17.     buildItems : function() {
  18.         return [
  19.             {
  20.                 xtype     : 'UsersGridPanel',
  21.                 width     : 280,
  22.                 itemId    : 'userGrid',
  23.                 listeners : {
  24.                     scope     : this,
  25.                     itemclick : this.onGridItemClick
  26.                 }
  27.             },
  28.             {
  29.                 xtype  : 'UserFormPanel',
  30.                 itemId : 'userForm',
  31.                 flex   : 1
  32.             }
  33.         ];
  34.     },
  35.     buildButtons : function() {
  36.         return [
  37.             {
  38.                 text    : 'Save',
  39.                 scope   : this,
  40.                 handler : this.onSaveBtn
  41.             },
  42.             {
  43.                 text    : 'New',
  44.                 scope   : this,
  45.                 handler : this.onNewBtn
  46.             }
  47.         ];
  48.     },
  49.     onGridItemClick : function(view, record) {
  50.         var formPanel = this.getComponent('userForm');
  51.         formPanel.loadRecord(record)
  52.     },
  53.     onSaveBtn : function() {
  54.         var gridPanel  = this.getComponent('userGrid'),
  55.             gridStore  = gridPanel.getStore(),
  56.             formPanel  = this.getComponent('userForm'),
  57.             basicForm  = formPanel.getForm(),
  58.             currentRec = basicForm.getRecord(),
  59.             formData   = basicForm.getValues(),
  60.             storeIndex = gridStore.indexOf(currentRec),
  61.             key;
  62.         //loop through the record and set values
  63.         currentRec.beginEdit();
  64.         for (key in formData) {
  65.             currentRec.set(key, formData[key]);
  66.         }
  67.         currentRec.endEdit();
  68.         currentRec.commit();
  69.         // Add and select
  70.         if (storeIndex == -1) {
  71.             gridStore.add(currentRec);
  72.             gridPanel.getSelectionModel().select(currentRec)
  73.         }
  74.     },
  75.     onNewBtn : function() {
  76.         var gridPanel = this.getComponent('userGrid'),
  77.             formPanel = this.getComponent('userForm'),
  78.             newModel  = Ext.ModelManager.create({}, 
  79.                               'MyApp.models.UserModel');
  80.         gridPanel.getSelectionModel().clearSelections();
  81.         formPanel.getForm().loadRecord(newModel)
  82.     },
  83.     onAfterRenderLoadForm : function() {
  84.         this.onNewBtn();
  85.     }
  86. });

UserEditorWindow 的代码包含了许多东西用来理UserGridPanel和UserFormPanelcȝ整个l定的声明周期。ؓ了指CExtJS在创cd加蝲q两个类Q必drequires列表里列出它们?/p>

现在完成最后一个文件app.js。ؓ了最大限度地提高我们的学习,有3ơ修改要做。首先从最单配|开始,然后逐步d?/p>

 
  1. Ext.Loader.setPath('MyApp', 'js/MyApp');
  2. Ext.onReady(function() {
  3.     Ext.create('MyApp.views.UserEditorWindow').show();
  4. });

首先Qapp.js会在ExtJSdMyApp命名I间的\径,q可通过调用Ext.loader.setPathҎ实现Q方法的W?个参数是命名I间Q然后是加蝲文g与页面的相对路径?/p>

下一步,调用Ext.OnReadyҎQ传递一个包含Ext.create的匿名函数。Ext.create会在ExtJS 4.0初始化之后执行,以字W串形式传递的UserEditorWindow cM被实例化。因Z需要指向实例和希望立即昄它,因而在后面串接了showҎ的调用?/p>

如果你打开q个面Q?a >http://moduscreate.com/senchaarticles/01/pass1.html Q,你会看到UI渲染Q但很慢Qƈ且ExtJS会在Firebug中显CZ下警告信息:

004

ExtJS提示我们没有使用加蝲pȝ最优化的方式。这是第二步要讨论的问题。然后,q是一个好的学习机会,要好好理由?/p>

     我们需要配|Firebug在控制台中显CXHRhQ以便在控制C看到所有请求,而不需要切换到|络面板。这P我们不单可以观察到类依赖pȝ的工作情况,q可以从所有ExtJScd载的文g中通过qo方式扑ֈ我们要求q样的文件?/p>

     在Firebug控制台过滤输入框中输?#8220;User”Q你会看C图所C的l果?/p>

005从图中可以看刎ͼUserEditorWindowcȝ一个被加蝲Q接着hUserGridPanel。UserGridPanel 要求UserStore和UserModelcR最后加载UserFormPanel cR?/p>

我刚才提刎ͼExtJS提示了我们没有用加载系l最优化的方式。这是因Z赖是在Ext.OnReady触发加蝲之后通过同步XHRh定的,而这不是有效的方式且难于调试?/p>

未来修正q个问题Q可以修改app.js指示ExtJS先加载我们定义的c,q样卛_提供性能又便于调试:

 
  1. Ext.Loader.setPath('MyApp', 'js/MyApp');
  2. Ext.require('MyApp.views.UserEditorWindow');
  3. Ext.onReady(function() {
  4.     Ext.create('MyApp.views.UserEditorWindow').show();
  5. });

Z快速加载我们定义的cd避免调试信息Q可单的在Ext.onReady前调用Ext.requireQ只是ExtJSh UserEditorWindowcR这会让ExtJS在文档HEAD标记内注入一个script标记Q运行资源在Ext.OnReady前加载?/p>

查看http://moduscreate.com/senchaarticles/01/pass2.html 可看到它是如何工作地。在面加蝲后,你会注意到ExtJS没有在控制台昄警告信息了?/p>

我们所做的是让ExtJS框架和应用类延迟加蝲。虽然这样做调试很好Q但是对于需要快速调试的情况Q页面渲染时间会让你感到痛苦。ؓ什么?

原因很简单,因ؓq需要加载许多资源文件。在CZ中,ExtJS发送了193个Javascript资源h到web服务器,q有部分是在~存中的Q?/p>

006

我们创徏?个Javascript文gQ?个类文g和app.jsQ,q意味着加蝲要求的ExtJS文g?87个请求。当你在本地做开发的时候,q个Ҏ可行Q但不是最理想的和效果最好的?/p>

解决q个问题Q我们可以用折中方案,通过ext-all-debug加蝲ExtJS框架Q动态加载我们的cL件。要实现q个Q需要修改两个文件?/p>

 
  1. <script type="text/javascript"  src="js/ext-4.0.1/ext-all-debug.js"></script>

首先Q需要修改Index.htmlQ用ext-all-debug.js替换ext.debug.js?/p>

接着Q修改app.jsQ开启Ext.LoaderQ?/p>

 
  1. (function() {
  2.     Ext.Loader.setConfig({
  3.         enabled : true,
  4.         paths   : {
  5.             MyApp : 'js/MyApp'
  6.         } 
  7.     });
  8.  
  9.     Ext.require('MyApp.views.UserEditorWindow');
  10.  
  11.     Ext.onReady(function() {
  12.         Ext.create('MyApp.views.UserEditorWindow').show();
  13.     });
  14. })();

通过调用Loader.setConfig可开启Ext.LoaderQ需要传递一个匿名对象,它的eanbled属性设|ؓtrueQ而命名空间设|ؓ路径映射?/p>

通过~辑app.jsQ在本地开发环境下Q应用将会在1U内完成加蝲和渲染?/p>

007

源代码下载地址Q?a title="http://moduscreate.com/senchaarticles/01/files.zip" >http://moduscreate.com/senchaarticles/01/files.zip

译文链接地址Q?a target="_blank" >blog.csdn.net/tianxiaode/archive/2011/06/28/6571589.aspx



helloworld2008 2011-07-28 15:46 发表评论
]]>
ExtJs xtype一?/title><link>http://www.aygfsteel.com/zhaochengming/archive/2011/07/28/355230.html</link><dc:creator>helloworld2008</dc:creator><author>helloworld2008</author><pubDate>Thu, 28 Jul 2011 07:37:00 GMT</pubDate><guid>http://www.aygfsteel.com/zhaochengming/archive/2011/07/28/355230.html</guid><wfw:comment>http://www.aygfsteel.com/zhaochengming/comments/355230.html</wfw:comment><comments>http://www.aygfsteel.com/zhaochengming/archive/2011/07/28/355230.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/zhaochengming/comments/commentRss/355230.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/zhaochengming/services/trackbacks/355230.html</trackback:ping><description><![CDATA[<div><table align="center" border="1" cellpadding="2" width="750"><tbody><tr><td colspan="3"><strong>基本lgQ?/strong></td> </tr> <tr style="font-weight: bold; color: black; font-style: italic; background-color: #f5f9f0;"> <td>xtype</td> <td>Class</td> <td>描述</td> </tr> <tr> <td>button</td> <td>Ext.Button</td> <td>按钮</td> </tr> <tr> <td>splitbutton</td> <td>Ext.SplitButton</td> <td>带下拉菜单的按钮</td> </tr> <tr> <td>cycle</td> <td>Ext.CycleButton</td> <td>带下拉选项菜单的按?/td> </tr> <tr> <td>buttongroup</td> <td>Ext.ButtonGroup</td> <td>~组按钮(Since 3.0)</td> </tr> <tr> <td>slider</td> <td>Ext.Slider</td> <td>滑动?/td> </tr> <tr> <td>progress</td> <td>Ext.ProgressBar</td> <td>q度?/td> </tr> <tr> <td>statusbar</td> <td>Ext.StatusBar</td> <td>状态条Q?.2加进来,3.0 又去?/td> </tr> <tr> <td>colorpalette</td> <td>Ext.ColorPalette</td> <td>调色?/td> </tr> <tr> <td>datepicker</td> <td>Ext.DatePicker</td> <td>日期选择面板</td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3">容器及数据类lg</td> </tr> <tr style="font-weight: bold; color: black; font-style: italic; background-color: #f5f9f0;"> <td style="color: black;">xtype</td> <td>Class</td> <td>描述</td> </tr> <tr> <td>window</td> <td>Ext.Window</td> <td>H口</td> </tr> <tr> <td>viewport</td> <td>Ext.ViewPort</td> <td>视口Q即览器的视口Q能随之伸羃</td> </tr> <tr> <td>box</td> <td>Ext.BoxComponent</td> <td>盒子lgQ相当于一?<div></td> </tr> <tr> <td>component</td> <td>Ext.Component</td> <td>lg</td> </tr> <tr> <td>container</td> <td>Ext.Container</td> <td>容器</td> </tr> <tr> <td>panel</td> <td>Ext.Panel</td> <td>面板</td> </tr> <tr> <td>tabpanel</td> <td>Ext.TabPanel</td> <td>选项面板</td> </tr> <tr> <td>treepanel</td> <td>Ext.tree.TreePanel</td> <td>树型面板</td> </tr> <tr> <td>flash</td> <td>Ext.FlashComponent</td> <td>昄 Flash 的组?Since 3.0)</td> </tr> <tr> <td>grid</td> <td>Ext.grid.GridPanel</td> <td>表格</td> </tr> <tr> <td>editorgrid</td> <td>Ext.grid.EditorGridPanel</td> <td>可编辑的表格</td> </tr> <tr> <td>propertygrid</td> <td>Ext.grid.PropertyGrid</td> <td>属性表?/td> </tr> <tr> <td>editor</td> <td>Ext.Editor</td> <td>~辑?/td> </tr> <tr> <td>dataview</td> <td>Ext.DataView</td> <td>数据昄视图</td> </tr> <tr> <td>listview</td> <td>Ext.ListView</td> <td>列表视图</td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3">工具栏组Ӟ</td> </tr> <tr style="font-weight: bold; color: black; font-style: italic; background-color: #f5f9f0;"> <td>xtype</td> <td>Class</td> <td>描述</td> </tr> <tr> <td>paging</td> <td>Ext.PagingToolbar</td> <td>分页工具?/td> </tr> <tr> <td>toolbar</td> <td>Ext.Toolbar</td> <td>工具?/td> </tr> <tr> <td>tbbutton</td> <td>Ext.Toolbar.Button</td> <td>工具栏按?/td> </tr> <tr> <td>tbfill</td> <td>Ext.Toolbar.Fill</td> <td>工具栏填充区</td> </tr> <tr> <td>tbitem</td> <td>Ext.Toolbar.Item</td> <td>工具条项?/td> </tr> <tr> <td>tbseparator</td> <td>Ext.Toolbar.Separator</td> <td>工具栏分隔符</td> </tr> <tr> <td>tbspacer</td> <td>Ext.Toolbar.Spacer</td> <td>工具栏空?/td> </tr> <tr> <td>tbsplit</td> <td>Ext.Toolbar.SplitButton</td> <td>工具栏分隔按?/td> </tr> <tr> <td>tbtext</td> <td>Ext.Toolbar.TextItem</td> <td>工具栏文本项</td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3">菜单lgQ?/td> </tr> <tr style="font-weight: bold; color: black; font-style: italic; background-color: #f5f9f0;"> <td>xtype</td> <td>Class</td> <td>描述</td> </tr> <tr> <td>menu</td> <td>Ext.menu.Menu</td> <td>菜单</td> </tr> <tr> <td>colormenu</td> <td>Ext.menu.ColorMenu</td> <td>颜色选择菜单</td> </tr> <tr> <td>datemenu</td> <td>Ext.menu.DateMenu</td> <td>日期选择菜单</td> </tr> <tr> <td>menubaseitem</td> <td>BaseItem</td> <td> </td> </tr> <tr> <td>menucheckitem</td> <td>Ext.menu.CheckItem</td> <td>选项菜单?/td> </tr> <tr> <td>menuitem</td> <td>Ext.menu.Item</td> <td> </td> </tr> <tr> <td>menuseparator</td> <td>Ext.menu.Separator</td> <td>菜单分隔U?/td> </tr> <tr> <td>menutextitem</td> <td>Ext.menu.TextItem</td> <td>文本菜单?/td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3">表单及表单域lgQ?/td> </tr> <tr style="font-weight: bold; color: black; font-style: italic; background-color: #f5f9f0;"> <td>xtype</td> <td>Class</td> <td>描述</td> </tr> <tr> <td>form</td> <td>Ext.FormPanel/Ext.form.FormPanel</td> <td>表单面板</td> </tr> <tr> <td>checkbox</td> <td>Ext.form.Checkbox</td> <td>多选框</td> </tr> <tr> <td>combo</td> <td>Ext.form.ComboBox</td> <td>下拉?/td> </tr> <tr> <td>datefield</td> <td>Ext.form.DateField</td> <td>日期选择?/td> </tr> <tr> <td>timefield</td> <td>Ext.form.TimeField</td> <td>旉录入?/td> </tr> <tr> <td>field</td> <td>Ext.form.Field</td> <td>表单字段</td> </tr> <tr> <td>fieldset</td> <td>Ext.form.FieldSet</td> <td>表单字段l?/td> </tr> <tr> <td>hidden</td> <td>Ext.form.Hidden</td> <td>表单隐藏?/td> </tr> <tr> <td>htmleditor</td> <td>Ext.form.HtmlEditor</td> <td>HTML ~辑?/td> </tr> <tr> <td>label</td> <td>Ext.form.Label</td> <td>标签</td> </tr> <tr> <td>numberfield</td> <td>Ext.form.NumberField</td> <td>数字~辑?/td> </tr> <tr> <td>radio</td> <td>Ext.form.Radio</td> <td>单选按?/td> </tr> <tr> <td>textarea</td> <td>Ext.form.TextArea</td> <td>多行文本?/td> </tr> <tr> <td>textfield</td> <td>Ext.form.TextField</td> <td>表单文本?/td> </tr> <tr> <td>trigger</td> <td>Ext.form.TriggerField</td> <td>触发录入?/td> </tr> <tr> <td>checkboxgroup</td> <td>Ext.form.CheckboxGroup</td> <td>~组的多选框(Since 2.2)</td> </tr> <tr> <td>displayfield</td> <td>Ext.form.DisplayField</td> <td>仅显C,不校?不被提交的文本框</td> </tr> <tr> <td>radiogroup</td> <td>Ext.form.RadioGroup</td> <td>~组的单选按?Since 2.2)</td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3">图表lgQ?/td> </tr> <tr style="font-weight: bold; color: black; font-style: italic; background-color: #f5f9f0;"> <td>xtype</td> <td>Class</td> <td>描述</td> </tr> <tr> <td>chart</td> <td>Ext.chart.Chart</td> <td>图表lg</td> </tr> <tr> <td>barchart</td> <td>Ext.chart.BarChart</td> <td>q?/td> </tr> <tr> <td>cartsianchart</td> <td>Ext.chart.CartesianChart</td> <td> </td> </tr> <tr> <td>columnchart</td> <td>Ext.chart.ColumnChart</td> <td> </td> </tr> <tr> <td>linechart</td> <td>Ext.chart.LineChart</td> <td>q线?/td> </tr> <tr> <td>piechart</td> <td>Ext.chart.PieChart</td> <td>扇Ş?/td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3">数据?StoreQ?/td> </tr> <tr style="font-weight: bold; color: black; font-style: italic; background-color: #f5f9f0;"> <td>xtype</td> <td>Class</td> <td>描述</td> </tr> <tr> <td>arraystore</td> <td>Ext.data.ArrayStore</td> <td> </td> </tr> <tr> <td>directstore</td> <td>Ext.data.DirectStore</td> <td> </td> </tr> <tr> <td>groupingstore</td> <td>Ext.data.GroupingStore</td> <td> </td> </tr> <tr> <td>jsonstore</td> <td>Ext.data.JsonStore</td> <td> </td> </tr> <tr> <td>simplestore</td> <td>Ext.data.SimpleStore</td> <td> </td> </tr> <tr> <td>store</td> <td>Ext.data.Store</td> <td> </td> </tr> <tr> <td>xmlstore</td> <td>Ext.data.XmlStore</td> <td> </td></tr></tbody></table></div><img src ="http://www.aygfsteel.com/zhaochengming/aggbug/355230.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/zhaochengming/" target="_blank">helloworld2008</a> 2011-07-28 15:37 <a href="http://www.aygfsteel.com/zhaochengming/archive/2011/07/28/355230.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>XML处理Ҏ字符http://www.aygfsteel.com/zhaochengming/archive/2010/12/02/339585.htmlhelloworld2008helloworld2008Thu, 02 Dec 2010 03:14:00 GMThttp://www.aygfsteel.com/zhaochengming/archive/2010/12/02/339585.htmlhttp://www.aygfsteel.com/zhaochengming/comments/339585.htmlhttp://www.aygfsteel.com/zhaochengming/archive/2010/12/02/339585.html#Feedback0http://www.aygfsteel.com/zhaochengming/comments/commentRss/339585.htmlhttp://www.aygfsteel.com/zhaochengming/services/trackbacks/339585.html在用xml文gӞ有时候内容中会含有一些特D字W,D在解析xml的时候出现异常?/p>

解析数据

XML 解析器通常情况下会处理XML文档中的所有文本?/p>

当XML元素被解析的时候,XML元素内部的文本也会被解析?/p>

    如果文本中含?#8220;<”Q?#8220;>”{特D的字符时将会出现异常。(当含?#8220;Q?#8221;ӞDataSet.ReadXml也会出现异常Q?/pre>
    一U解x法是Q用实体&来表C?/pre>

下面是五个在XML文档中预定义好的实体:

&lt; < 于?/td>
&gt; > 大于?/td>
&amp; & ?/td>
&apos; ' 单引?/td>
&quot; " 双引?/td>
另一U解x法是使用CDATA部gQ?/pre>

一?CDATA 部g?<![CDATA[" 标记开始,?]]>"标记l束

所有在CDATA部g之间的文本都会被解析器忽略?/p>

CDATA注意事项:

CDATA部g之间不能再包含CDATA部gQ不能嵌套)。如果CDATA部g包含了字W?]]>" 或?<![CDATA[" Q将很有可能出错?/p>

同样要注意在字符?]]>"之间没有I格或者换行符?/p>



helloworld2008 2010-12-02 11:14 发表评论
]]>XML处理Ҏ字符http://www.aygfsteel.com/zhaochengming/archive/2010/12/02/339586.htmlhelloworld2008helloworld2008Thu, 02 Dec 2010 03:14:00 GMThttp://www.aygfsteel.com/zhaochengming/archive/2010/12/02/339586.htmlhttp://www.aygfsteel.com/zhaochengming/comments/339586.htmlhttp://www.aygfsteel.com/zhaochengming/archive/2010/12/02/339586.html#Feedback0http://www.aygfsteel.com/zhaochengming/comments/commentRss/339586.htmlhttp://www.aygfsteel.com/zhaochengming/services/trackbacks/339586.html在用xml文gӞ有时候内容中会含有一些特D字W,D在解析xml的时候出现异常?/p>

解析数据

XML 解析器通常情况下会处理XML文档中的所有文本?/p>

当XML元素被解析的时候,XML元素内部的文本也会被解析?/p>

    如果文本中含?#8220;<”Q?#8220;>”{特D的字符时将会出现异常。(当含?#8220;Q?#8221;ӞDataSet.ReadXml也会出现异常Q?/pre>
    一U解x法是Q用实体&来表C?/pre>

下面是五个在XML文档中预定义好的实体:

&lt; < 于?/td>
&gt; > 大于?/td>
&amp; & ?/td>
&apos; ' 单引?/td>
&quot; " 双引?/td>
另一U解x法是使用CDATA部gQ?/pre>

一?CDATA 部g?<![CDATA[" 标记开始,?]]>"标记l束

所有在CDATA部g之间的文本都会被解析器忽略?/p>

CDATA注意事项:

CDATA部g之间不能再包含CDATA部gQ不能嵌套)。如果CDATA部g包含了字W?]]>" 或?<![CDATA[" Q将很有可能出错?/p>

同样要注意在字符?]]>"之间没有I格或者换行符?/p>



helloworld2008 2010-12-02 11:14 发表评论
]]>javascript技巧合?Q{自http://ttyp.cnblogs.com/archive/2004/11/15/63900.htmlQ?/title><link>http://www.aygfsteel.com/zhaochengming/archive/2010/04/09/317837.html</link><dc:creator>helloworld2008</dc:creator><author>helloworld2008</author><pubDate>Fri, 09 Apr 2010 05:01:00 GMT</pubDate><guid>http://www.aygfsteel.com/zhaochengming/archive/2010/04/09/317837.html</guid><wfw:comment>http://www.aygfsteel.com/zhaochengming/comments/317837.html</wfw:comment><comments>http://www.aygfsteel.com/zhaochengming/archive/2010/04/09/317837.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.aygfsteel.com/zhaochengming/comments/commentRss/317837.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/zhaochengming/services/trackbacks/317837.html</trackback:ping><description><![CDATA[     摘要: 事g源对? event.srcElement.tagName event.srcElement.type 捕获释放 event.srcElement.setCapture();  event.srcElement.releaseCapture();  事g按键 event.keyCode ...  <a href='http://www.aygfsteel.com/zhaochengming/archive/2010/04/09/317837.html'>阅读全文</a><img src ="http://www.aygfsteel.com/zhaochengming/aggbug/317837.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/zhaochengming/" target="_blank">helloworld2008</a> 2010-04-09 13:01 <a href="http://www.aygfsteel.com/zhaochengming/archive/2010/04/09/317837.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>上百个让你事半功倍的jquery插g(?http://www.aygfsteel.com/zhaochengming/archive/2010/03/25/316517.htmlhelloworld2008helloworld2008Thu, 25 Mar 2010 05:01:00 GMThttp://www.aygfsteel.com/zhaochengming/archive/2010/03/25/316517.htmlhttp://www.aygfsteel.com/zhaochengming/comments/316517.htmlhttp://www.aygfsteel.com/zhaochengming/archive/2010/03/25/316517.html#Feedback0http://www.aygfsteel.com/zhaochengming/comments/commentRss/316517.htmlhttp://www.aygfsteel.com/zhaochengming/services/trackbacks/316517.html阅读全文

helloworld2008 2010-03-25 13:01 发表评论
]]>
15个友好的jQuery提示框插? ?http://www.aygfsteel.com/zhaochengming/archive/2010/03/25/316516.htmlhelloworld2008helloworld2008Thu, 25 Mar 2010 04:39:00 GMThttp://www.aygfsteel.com/zhaochengming/archive/2010/03/25/316516.htmlhttp://www.aygfsteel.com/zhaochengming/comments/316516.htmlhttp://www.aygfsteel.com/zhaochengming/archive/2010/03/25/316516.html#Feedback0http://www.aygfsteel.com/zhaochengming/comments/commentRss/316516.htmlhttp://www.aygfsteel.com/zhaochengming/services/trackbacks/316516.html 

需要在用户把光标移到某个元素上时显CZ些额外信息时Q提C框是一U不错的方式Q提C框会在鼠标停留的时候显C,鼠标Ud时消失?/p>

适当的用提C框能大大提升网站的友好度,q且可以节省一些不必要的网늩_今天我们看?5Ƒֈ作友好的提示框的jQuery插g?/p>

1. qTip

qTip是一Ƒ֊能高U的提示框插Ӟ它提供了非常多的Ҏ,包括圆角框、提C泡等?br /> qtip

2. jQuery Tools/Tooltips

q个提示框插件能够显CZQ何的HTML元素Q比如链接、表根{表单、图片,实现q些效果是很L的,你也可以L制作q牚w格的提示框?img class="alignnone size-full wp-image-585" title="jquery-tools-tooltips" alt="jquery-tools-tooltips" src="http://www.webdesignbooth.com/wp-content/uploads/2009/06/jquery-tools-tooltips.png" width="500" height="132" />

3. Simpletip

Simpletip 允许你通过Jquery的元素选择器和事g理器轻村֜M元素上制作提C框Q提C框可以佉K态的、动态的、甚臛_以通过ajax加蝲Qƈ且都有非常多不懂的显C效果?/p>

simpletip

4. jQuery (mb)Tooltip

jQuery (mb)Tooltip是一N过 jQuery timers 和半透明阴媄插g实现的漂亮的提示框插Ӟ它ؓ各种需求提供很多可选项?/p>

5. EZPZ Tooltip

你不需要添加Q何CSS或图片就可以扩展、定制提C框的样式风根{?/p>

ezpz-tooltip

6. jQuery Input Floating Hint Box

q个插g在表单右Ҏ供一个自动变化的提示框,当输入框获得焦点时它׃昄Q失ȝҎ隐藏?img class="alignnone size-full wp-image-588" title="iquery-input-floating-hint-box" alt="iquery-input-floating-hint-box" src="http://www.webdesignbooth.com/wp-content/uploads/2009/06/iquery-input-floating-hint-box.png" width="465" height="150" />

7. HTML Tooltip

html-tooltip

8. Orbital Tooltip

你可以用 Orbital Tooltip在目标元素的360°M一个位|制作出一个提C框?orbital-tooltip

9. Tipsy

Facebook风格的提C框插g?br /> tipsy

10. clueTip

cluetip



helloworld2008 2010-03-25 12:39 发表评论
]]>
clientheight clientwidth offsetheight offsetwidthhttp://www.aygfsteel.com/zhaochengming/archive/2010/03/20/316029.htmlhelloworld2008helloworld2008Sat, 20 Mar 2010 09:53:00 GMThttp://www.aygfsteel.com/zhaochengming/archive/2010/03/20/316029.htmlhttp://www.aygfsteel.com/zhaochengming/comments/316029.htmlhttp://www.aygfsteel.com/zhaochengming/archive/2010/03/20/316029.html#Feedback0http://www.aygfsteel.com/zhaochengming/comments/commentRss/316029.htmlhttp://www.aygfsteel.com/zhaochengming/services/trackbacks/316029.html

div的样式如下:
width:300px;
height:200px;
padding:10px;
border:10px solid #ccc;
background:#eee;
font-size:12px;



则:

IE6.0、FF1.06+Q?/strong>
clientWidth = width + padding = 300+10×2 = 320
clientHeight = height + padding = 200+10×2 = 220
offsetWidth = width + padding + border = 300+10×2+10×2= 340
offsetHeight = height + padding + border = 200+10×2+10×2 = 240

IE5.0/5.5Q?/strong>
clientWidth = width - border = 300-10×2 = 280
clientHeight = height - border = 200-10×2 = 180
offsetWidth = width = 300
offsetHeight = height = 200



helloworld2008 2010-03-20 17:53 发表评论
]]>
padding margin border 区别http://www.aygfsteel.com/zhaochengming/archive/2010/03/20/316028.htmlhelloworld2008helloworld2008Sat, 20 Mar 2010 09:47:00 GMThttp://www.aygfsteel.com/zhaochengming/archive/2010/03/20/316028.htmlhttp://www.aygfsteel.com/zhaochengming/comments/316028.htmlhttp://www.aygfsteel.com/zhaochengming/archive/2010/03/20/316028.html#Feedback0http://www.aygfsteel.com/zhaochengming/comments/commentRss/316028.htmlhttp://www.aygfsteel.com/zhaochengming/services/trackbacks/316028.html

Ҏ属?font face="Times New Roman">(border)用来讑֮一个元素的边线?/font>

边距属?font face="Times New Roman">(margin)是用来设|一个元素所占空间的边缘到相d素之间的距离?/font>

间隙属?font face="Times New Roman">(padding)是用来设|元素内容到元素边界的距R?/font>

q三个属性都属于CSS?/font>boxcd的属性?/font>

下面q个C意图,很Ş象地体现了三者之间的区别?/span>

q里提供一张盒模型?font face="Times New Roman">3DC意图,希望便于你的理解和记忆?/font>



helloworld2008 2010-03-20 17:47 发表评论
]]>
javaScript屏蔽按键 ( 转自:http://hi.baidu.com/shunxinyangkun/blog/item/7090911ba576f8d4ac6e7576.html )http://www.aygfsteel.com/zhaochengming/archive/2008/10/08/233119.htmlhelloworld2008helloworld2008Wed, 08 Oct 2008 05:10:00 GMThttp://www.aygfsteel.com/zhaochengming/archive/2008/10/08/233119.htmlhttp://www.aygfsteel.com/zhaochengming/comments/233119.htmlhttp://www.aygfsteel.com/zhaochengming/archive/2008/10/08/233119.html#Feedback0http://www.aygfsteel.com/zhaochengming/comments/commentRss/233119.htmlhttp://www.aygfsteel.com/zhaochengming/services/trackbacks/233119.html <head>
   <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
   <noscript><meta http-equiv="refresh" content="0;url=about:noscript"></noscript>
   <title>屏蔽鼠标右键、Ctrl+N、Shift+F10、Alt+F4、F11、F5h、退格键</title>
</head>
<body>
<script language="Javascript"><!--
  //屏蔽鼠标右键、Ctrl+N、Shift+F10、F11、F5h、退格键
  //Author: meizz(梅花? 2002-6-18
function
document.oncontextmenu(){event.returnValue=false;}//屏蔽鼠标右键
function
window.onhelp(){return false} //屏蔽F1帮助
function
document.onkeydown()
{
  if ((window.event.altKey)&&
       ((window.event.keyCode==37)||   //屏蔽 Alt+ 方向?←
        (window.event.keyCode==39)))   //屏蔽 Alt+ 方向?→
   {
      alert("不准你用ALT+方向键前q或后退|页Q?);
      event.returnValue=false;
   }
     /* 注:q还不是真正地屏?Alt+ 方向键,
      因ؓ Alt+ 方向键弹告框Ӟ按住 Alt 键不放,
      用鼠标点掉警告框Q这U屏蔽方法就失效了。以后若
      有哪位高手有真正屏蔽 Alt 键的ҎQ请告知?/

  if ((event.keyCode==8)   ||                 //屏蔽退格删除键
       (event.keyCode==116)||                 //屏蔽 F5 h?
       (event.ctrlKey && event.keyCode==82)){ //Ctrl + R
      event.keyCode=0;
      event.returnValue=false;
      }
  if (event.keyCode==122){event.keyCode=0;event.returnValue=false;}  //屏蔽F11
  if (event.ctrlKey && event.keyCode==78) event.returnValue=false;   //屏蔽 Ctrl+n
  if (event.shiftKey && event.keyCode==121)event.returnValue=false;  //屏蔽 shift+F10
  if (window.event.srcElement.tagName == "A" && window.event.shiftKey)  
       window.event.returnValue = false;             //屏蔽 shift 加鼠标左键新开一|页
  if ((window.event.altKey)&&(window.event.keyCode==115))             //屏蔽Alt+F4
   {
       window.showModelessDialog("about:blank","","dialogWidth:1px;dialogheight:1px");
      return false;
   }
}
</script>
屏蔽鼠标右键、Ctrl+N、Shift+F10、Alt+F4、F11、F5h、退格键
</body>
</html>

helloworld2008 2008-10-08 13:10 发表评论
]]>
多语a注意?/title><link>http://www.aygfsteel.com/zhaochengming/archive/2008/09/09/227959.html</link><dc:creator>helloworld2008</dc:creator><author>helloworld2008</author><pubDate>Tue, 09 Sep 2008 07:14:00 GMT</pubDate><guid>http://www.aygfsteel.com/zhaochengming/archive/2008/09/09/227959.html</guid><wfw:comment>http://www.aygfsteel.com/zhaochengming/comments/227959.html</wfw:comment><comments>http://www.aygfsteel.com/zhaochengming/archive/2008/09/09/227959.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/zhaochengming/comments/commentRss/227959.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/zhaochengming/services/trackbacks/227959.html</trackback:ping><description><![CDATA[<p style="margin-left: 18pt; text-indent: -18pt; tab-stops: list 18.0pt">1.<span style="font: 7pt 'Times New Roman'">       </span>Jboss/Tomcat<span style="font-family: 宋体">中的</span>server.xml<span style="font-family: 宋体">?/span><Connector><span style="font-family: 宋体">中加?/span>URIEncoding="utf-8"</p> <img src ="http://www.aygfsteel.com/zhaochengming/aggbug/227959.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/zhaochengming/" target="_blank">helloworld2008</a> 2008-09-09 15:14 <a href="http://www.aygfsteel.com/zhaochengming/archive/2008/09/09/227959.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>javascript 获取屏幕及浏览器大小和坐标等http://www.aygfsteel.com/zhaochengming/archive/2008/09/09/227958.htmlhelloworld2008helloworld2008Tue, 09 Sep 2008 07:13:00 GMThttp://www.aygfsteel.com/zhaochengming/archive/2008/09/09/227958.htmlhttp://www.aygfsteel.com/zhaochengming/comments/227958.htmlhttp://www.aygfsteel.com/zhaochengming/archive/2008/09/09/227958.html#Feedback0http://www.aygfsteel.com/zhaochengming/comments/commentRss/227958.htmlhttp://www.aygfsteel.com/zhaochengming/services/trackbacks/227958.htmldocument.body.offsetHeight是获?lt;body>内的高度信息
转自Qhttp://hi.baidu.com/collect_zero/blog/item/5fc3e8012686f8071d95838f.html


window.screen.width是获取整个屏q的高度信息Q浏览器最大化的情况下?#8221;1024”

window.screen.width是获取整个屏q去除Q务栏后的高度信息Q浏览器最大化的情况下?#8221;1004”

|页可见区域宽:document.body.clientWidth
|页可见区域高:document.body.clientHeight
|页可见区域宽:document.body.offsetWidth (包括边线的宽)
|页可见区域高:document.body.offsetHeight (包括边线的宽)
|页正文全文宽:document.body.scrollWidth
|页正文全文高:document.body.scrollHeight
|页被卷ȝ高:document.body.scrollTop
|页被卷ȝ左:document.body.scrollLeft
|页正文部分上:window.screenTop
|页正文部分左:window.screenLeft
屏幕分L率的高:window.screen.height
屏幕分L率的宽:window.screen.width
屏幕可用工作区高度:window.screen.availHeight
屏幕可用工作区宽度:window.screen.availWidth



helloworld2008 2008-09-09 15:13 发表评论
]]>
html table 标题 不滚?/title><link>http://www.aygfsteel.com/zhaochengming/archive/2008/09/04/226835.html</link><dc:creator>helloworld2008</dc:creator><author>helloworld2008</author><pubDate>Thu, 04 Sep 2008 01:12:00 GMT</pubDate><guid>http://www.aygfsteel.com/zhaochengming/archive/2008/09/04/226835.html</guid><wfw:comment>http://www.aygfsteel.com/zhaochengming/comments/226835.html</wfw:comment><comments>http://www.aygfsteel.com/zhaochengming/archive/2008/09/04/226835.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.aygfsteel.com/zhaochengming/comments/commentRss/226835.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/zhaochengming/services/trackbacks/226835.html</trackback:ping><description><![CDATA[<style type="text/css"> <!-- body { background: #FFF; color: #000; font: normal normal 12px Verdana, Geneva, Arial, Helvetica, sans-serif; margin: 10px; padding: 0 } table, td, a { color: #000; font: normal normal 12px Verdana, Geneva, Arial, Helvetica, sans-serif } .td { nowrap:’’true’’; } div.tableContainer { clear: both; border: 1px solid #963; height: 285px; overflow: auto; width: 100%; } /* WinIE 6.x needs to re-account for it’’s scrollbar. Give it some padding */ \html div.tableContainer/* */ { padding: 0 16px 0 0 } /* clean up for allowing display Opera 5.x/6.x and MacIE 5.x */ html>body div.tableContainer { height: auto; padding: 0; width: 740px } /* Reset overflow value to hidden for all non-IE browsers. */ /* Filter out Opera 5.x/6.x and MacIE 5.x */ head:first-child+body div[class].tableContainer { height: 285px; overflow: hidden; width: 756px } /* define width of table. IE browsers only */ /* if width is set to 100%, you can remove the width */ /* property from div.tableContainer and have the div scale */ div.tableContainer table { float: left; width: 100% } /* WinIE 6.x needs to re-account for padding. Give it a negative margin */ \html div.tableContainer table/* */ { margin: 0 -16px 0 0 } /* define width of table. Opera 5.x/6.x and MacIE 5.x */ html>body div.tableContainer table { float: none; margin: 0; width: 740px } /* define width of table. Add 16px to width for scrollbar. */ /* All other non-IE browsers. Filter out Opera 5.x/6.x and MacIE 5.x */ head:first-child+body div[class].tableContainer table { width: 756px } /* set table header to a fixed position. WinIE 6.x only */ /* In WinIE 6.x, any element with a position property set to relative and is a child of */ /* an element that has an overflow property set, the relative value translates into fixed. */ /* Ex: parent element DIV with a class of tableContainer has an overflow property set to auto */ thead.fixedHeader tr { position: relative; /* expression is for WinIE 5.x only. Remove to validate and for pure CSS solution */ top: expression(document.getElementById("tableContainer").scrollTop) } thead.fixedHeader2 tr { position: relative; /* expression is for WinIE 5.x only. Remove to validate and for pure CSS solution */ bottom: expression(document.getElementById("tableContainer").scrollHeight > document.getElementById("tableContainer").clientHeight ? document.getElementById("tableContainer").scrollHeight - document.getElementById("tableContainer").scrollTop - document.getElementById("tableContainer").clientHeight :0) } /* set THEAD element to have block level attributes. All other non-IE browsers */ /* this enables overflow to work on TBODY element. All other non-IE, non-Mozilla browsers */ /* Filter out Opera 5.x/6.x and MacIE 5.x */ head:first-child+body thead[class].fixedHeader tr { display: block } /* make the TH elements pretty */ thead.fixedHeader th { background: #C96; border-left: 1px solid #EB8; border-right: 1px solid #B74; border-top: 1px solid #EB8; font-weight: normal; padding: 4px 3px; text-align: center } /* make the TH elements pretty */ thead.fixedHeader2 th { background: #C96; border-left: 1px solid #EB8; border-right: 1px solid #B74; border-top: 1px solid #EB8; font-weight: normal; padding: 4px 3px; text-align: left } /* make the A elements pretty. makes for nice clickable headers */ thead.fixedHeader a, thead.fixedHeader a:link, thead.fixedHeader a:visited { color: #FFF; display: block; text-decoration: none; width: 100% } thead.fixedHeader2 a, thead.fixedHeader2 a:link, thead.fixedHeader a:visited { color: #FFF; display: block; text-decoration: none; width: 100% } /* make the A elements pretty. makes for nice clickable headers */ /* WARNING: swapping the background on hover may cause problems in WinIE 6.x */ thead.fixedHeader a:hover { color: #FFF; display: block; text-decoration: underline; width: 100% } /* define the table content to be scrollable */ /* set TBODY element to have block level attributes. All other non-IE browsers */ /* this enables overflow to work on TBODY element. All other non-IE, non-Mozilla browsers */ /* induced side effect is that child TDs no longer accept width: auto */ /* Filter out Opera 5.x/6.x and MacIE 5.x */ head:first-child+body tbody[class].scrollContent { display: block; height: 262px; overflow: auto; width: 100% } /* make TD elements pretty. Provide alternating classes for striping the table */ /* http://www.alistapart.com/articles/zebratables/ */ tbody.scrollContent td, tbody.scrollContent tr.normalRow td { background: #FFF; border-bottom: 1px solid #EEE; border-left: 1px solid #EEE; border-right: 1px solid #AAA; border-top: 1px solid #AAA; padding: 2px 3px } tbody.scrollContent tr.alternateRow td { background: #EEE; border-bottom: 1px solid #EEE; border-left: 1px solid #EEE; border-right: 1px solid #AAA; border-top: 1px solid #AAA; padding: 2px 3px } /* define width of TH elements: 1st, 2nd, and 3rd respectively. */ /* All other non-IE browsers. Filter out Opera 5.x/6.x and MacIE 5.x */ /* Add 16px to last TH for scrollbar padding */ /* http://www.w3.org/TR/REC-CSS2/selector.html#adjacent-selectors */ head:first-child+body thead[class].fixedHeader th { width: 200px } head:first-child+body thead[class].fixedHeader th + th { width: 250px } head:first-child+body thead[class].fixedHeader th + th + th { border-right: none; padding: 4px 4px 4px 3px; width: 316px } /* define width of TH elements: 1st, 2nd, and 3rd respectively. */ /* All other non-IE browsers. Filter out Opera 5.x/6.x and MacIE 5.x */ /* Add 16px to last TH for scrollbar padding */ /* http://www.w3.org/TR/REC-CSS2/selector.html#adjacent-selectors */ head:first-child+body tbody[class].scrollContent td { width: 200px } head:first-child+body tbody[class].scrollContent td + td { width: 250px } head:first-child+body tbody[class].scrollContent td + td + td { border-right: none; padding: 2px 4px 2px 3px; width: 300px /* expression is for WinIE 5.x only. Remove to validate and for pure CSS solution */ top: expression(document.getElementById("tableContainer").scrollTop) } --> </style> <script> function test() { var cH = document.getElementById("tableContainer").clientHeight; var sH = document.getElementById("tableContainer").scrollHeight; var sT = document.getElementById("tableContainer").scrollTop; alert(cH+":"+sH+":"+sT); } </script> <div id="wmqeeuq" class="tableContainer" id="tableContainer"> <table class="scrollTable" cellspacing="0" cellpadding="0" width="100%" border="0"> <thead class="fixedHeader"> <tr> <th><a onclick="javascript:test();" href="#">Header 1</a></th> <th><a href="#">Header 2</a></th> <th><a href="#">Header 3</a></th> <th><a href="#">Header 4</a></th> </tr> </thead> <tbody class="scrollContent"> <tr> <td>Cell Content 1</td> <td>Cell Content 2</td> <td>Cell Content 3</td> <td>Cell Content 4</td> </tr> <tr> <td>More Cell Content 1</td> <td>More Cell Content 2</td> <td>More Cell Content 3</td> <td>More Cell Content 4</td> </tr> <tr> <td noWrap>Even More Cell Content 1</td> <td noWrap>Even More Cell Content 2</td> <td noWrap>Even More Cell Content 3</td> <td noWrap>Even More Cell Content 4</td> </tr> <tr> <td>And Repeat 1</td> <td>And Repeat 2</td> <td>And Repeat 3</td> <td>And Repeat 4</td> </tr> <tr> <td>And Repeat 1</td> <td>And Repeat 2</td> <td>And Repeat 3</td> <td>And Repeat 4</td> </tr> <tr> <td>And Repeat 1</td> <td>And Repeat 2</td> <td>And Repeat 3</td> <td>And Repeat 4</td> </tr> <tr> <td>And Repeat 1</td> <td>And Repeat 2</td> <td>And Repeat 3</td> <td>And Repeat 4</td> </tr> <tr> <td>And Repeat 1</td> <td>And Repeat 2</td> <td>And Repeat 3</td> <td>And Repeat 4</td> </tr> <tr> <td>And Repeat 1</td> <td>And Repeat 2</td> <td>And Repeat 3</td> <td>And Repeat 4</td> </tr> <tr> <td>And Repeat 1</td> <td>And Repeat 2</td> <td>And Repeat 3</td> <td>And Repeat 4</td> </tr> <tr> <td>And Repeat 1</td> <td>And Repeat 2</td> <td>And Repeat 3</td> <td>And Repeat 4</td> </tr> <tr> <td>And Repeat 1</td> <td>And Repeat 2</td> <td>And Repeat 3</td> <td>And Repeat 4</td> </tr> <tr> <td>And Repeat 1</td> <td>And Repeat 2</td> <td>And Repeat 3</td> <td>And Repeat 4</td> </tr> <tr> <td>And Repeat 1</td> <td>And Repeat 2</td> <td>And Repeat 3</td> <td>And Repeat 4</td> </tr> <tr> <td>And Repeat 1</td> <td>And Repeat 2</td> <td>And Repeat 3</td> <td>And Repeat 4</td> </tr> <tr> <td>And Repeat 1</td> <td>And Repeat 2</td> <td>And Repeat 3</td> <td>And Repeat 4</td> </tr> <tr> <td>And Repeat 1</td> <td>And Repeat 2</td> <td>And Repeat 3</td> <td>And Repeat 4</td> </tr> <tr> <td>And Repeat 1</td> <td>And Repeat 2</td> <td>And Repeat 3</td> <td>And Repeat 4</td> </tr> <tr> <td>And Repeat 1</td> <td>And Repeat 2</td> <td>And Repeat 3</td> <td>最?7</td> </tr> </tbody> <thead class="fixedHeader2"> <tr> <th><a href="#">合计:</a></th> <th colspan="6"><a href="#">10000</a></th> </tr> </thead> </table> </div> <br /> <br /> 代码 <br /> <p><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>  <br /> <style type="text/css">  <br /> <!--  <br /> body {  <br /> background: #FFF;  <br /> color: #000;  <br /> font: normal normal 12px Verdana, Geneva, Arial, Helvetica, sans-serif;  <br /> margin: 10px;  <br /> padding: 0  <br /> }  </p> <p>table, td, a {  <br /> color: #000;  <br /> font: normal normal 12px Verdana, Geneva, Arial, Helvetica, sans-serif  <br /> }  </p> <p>.td  <br /> {  <br /> nowrap:’’true’’;  <br /> }  </p> <p>div.tableContainer {  <br /> clear: both;  <br /> border: 1px solid #963;  <br /> height: 285px;  <br /> overflow: auto;  <br /> width: 100%;  <br /> }  </p> <p>/* WinIE 6.x needs to re-account for it’’s scrollbar. Give it some padding */  <br /> \html div.tableContainer/* */ {  <br /> padding: 0 16px 0 0  <br /> }  </p> <p>/* clean up for allowing display Opera 5.x/6.x and MacIE 5.x */  <br /> html>body div.tableContainer {  <br /> height: auto;  <br /> padding: 0;  <br /> width: 740px  <br /> }  </p> <p>/* Reset overflow value to hidden for all non-IE browsers. */  <br /> /* Filter out Opera 5.x/6.x and MacIE 5.x */  <br /> head:first-child+body div[class].tableContainer {  <br /> height: 285px;  <br /> overflow: hidden;  <br /> width: 756px  <br /> }  </p> <p>/* define width of table. IE browsers only */  <br /> /* if width is set to 100%, you can remove the width */  <br /> /* property from div.tableContainer and have the div scale */  <br /> div.tableContainer table {  <br /> float: left;  <br /> width: 100%  <br /> }  </p> <p>/* WinIE 6.x needs to re-account for padding. Give it a negative margin */  <br /> \html div.tableContainer table/* */ {  <br /> margin: 0 -16px 0 0  <br /> }  </p> <p>/* define width of table. Opera 5.x/6.x and MacIE 5.x */  <br /> html>body div.tableContainer table {  <br /> float: none;  <br /> margin: 0;  <br /> width: 740px  <br /> }  </p> <p>/* define width of table. Add 16px to width for scrollbar. */  <br /> /* All other non-IE browsers. Filter out Opera 5.x/6.x and MacIE 5.x */  <br /> head:first-child+body div[class].tableContainer table {  <br /> width: 756px  <br /> }  </p> <p>/* set table header to a fixed position. WinIE 6.x only */  <br /> /* In WinIE 6.x, any element with a position property set to relative and is a child of */  <br /> /* an element that has an overflow property set, the relative value translates into fixed. */  <br /> /* Ex: parent element DIV with a class of tableContainer has an overflow property set to auto */  <br /> thead.fixedHeader tr {  <br /> position: relative;  <br /> /* expression is for WinIE 5.x only. Remove to validate and for pure CSS solution */  <br /> top: expression(document.getElementById("tableContainer").scrollTop)  <br /> }  <br /> thead.fixedHeader2 tr {  <br /> position: relative;  <br /> /* expression is for WinIE 5.x only. Remove to validate and for pure CSS solution */  <br /> bottom: expression(document.getElementById("tableContainer").scrollHeight > document.getElementById("tableContainer").clientHeight ? document.getElementById("tableContainer").scrollHeight - document.getElementById("tableContainer").scrollTop - document.getElementById("tableContainer").clientHeight :0)  <br /> }  </p> <p>/* set THEAD element to have block level attributes. All other non-IE browsers */  <br /> /* this enables overflow to work on TBODY element. All other non-IE, non-Mozilla browsers */  <br /> /* Filter out Opera 5.x/6.x and MacIE 5.x */  <br /> head:first-child+body thead[class].fixedHeader tr {  <br /> display: block  <br /> }  </p> <p>/* make the TH elements pretty */  <br /> thead.fixedHeader th {  <br /> background: #C96;  <br /> border-left: 1px solid #EB8;  <br /> border-right: 1px solid #B74;  <br /> border-top: 1px solid #EB8;  <br /> font-weight: normal;  <br /> padding: 4px 3px;  <br /> text-align: center  <br /> }  <br /> /* make the TH elements pretty */  <br /> thead.fixedHeader2 th {  <br /> background: #C96;  <br /> border-left: 1px solid #EB8;  <br /> border-right: 1px solid #B74;  <br /> border-top: 1px solid #EB8;  <br /> font-weight: normal;  <br /> padding: 4px 3px;  <br /> text-align: left  <br /> }  <br /> /* make the A elements pretty. makes for nice clickable headers */  <br /> thead.fixedHeader a, thead.fixedHeader a:link, thead.fixedHeader a:visited {  <br /> color: #FFF;  <br /> display: block;  <br /> text-decoration: none;  <br /> width: 100%  <br /> }  <br /> thead.fixedHeader2 a, thead.fixedHeader2 a:link, thead.fixedHeader a:visited {  <br /> color: #FFF;  <br /> display: block;  <br /> text-decoration: none;  <br /> width: 100%  <br /> }  </p> <p>/* make the A elements pretty. makes for nice clickable headers */  <br /> /* WARNING: swapping the background on hover may cause problems in WinIE 6.x */  <br /> thead.fixedHeader a:hover {  <br /> color: #FFF;  <br /> display: block;  <br /> text-decoration: underline;  <br /> width: 100%  <br /> }  </p> <p>/* define the table content to be scrollable */  <br /> /* set TBODY element to have block level attributes. All other non-IE browsers */  <br /> /* this enables overflow to work on TBODY element. All other non-IE, non-Mozilla browsers */  <br /> /* induced side effect is that child TDs no longer accept width: auto */  <br /> /* Filter out Opera 5.x/6.x and MacIE 5.x */  <br /> head:first-child+body tbody[class].scrollContent {  <br /> display: block;  <br /> height: 262px;  <br /> overflow: auto;  <br /> width: 100%  <br /> }  </p> <p>/* make TD elements pretty. Provide alternating classes for striping the table */  <br /> /* http://www.alistapart.com/articles/zebratables/ */  <br /> tbody.scrollContent td, tbody.scrollContent tr.normalRow td {  <br /> background: #FFF;  <br /> border-bottom: 1px solid #EEE;  <br /> border-left: 1px solid #EEE;  <br /> border-right: 1px solid #AAA;  <br /> border-top: 1px solid #AAA;  <br /> padding: 2px 3px  <br /> }  </p> <p>tbody.scrollContent tr.alternateRow td {  <br /> background: #EEE;  <br /> border-bottom: 1px solid #EEE;  <br /> border-left: 1px solid #EEE;  <br /> border-right: 1px solid #AAA;  <br /> border-top: 1px solid #AAA;  <br /> padding: 2px 3px  <br /> }  </p> <p>/* define width of TH elements: 1st, 2nd, and 3rd respectively. */  <br /> /* All other non-IE browsers. Filter out Opera 5.x/6.x and MacIE 5.x */  <br /> /* Add 16px to last TH for scrollbar padding */  <br /> /* http://www.w3.org/TR/REC-CSS2/selector.html#adjacent-selectors */  <br /> head:first-child+body thead[class].fixedHeader th {  <br /> width: 200px  <br /> }  </p> <p>head:first-child+body thead[class].fixedHeader th + th {  <br /> width: 250px  <br /> }  </p> <p>head:first-child+body thead[class].fixedHeader th + th + th {  <br /> border-right: none;  <br /> padding: 4px 4px 4px 3px;  <br /> width: 316px  <br /> }  </p> <p>/* define width of TH elements: 1st, 2nd, and 3rd respectively. */  <br /> /* All other non-IE browsers. Filter out Opera 5.x/6.x and MacIE 5.x */  <br /> /* Add 16px to last TH for scrollbar padding */  <br /> /* http://www.w3.org/TR/REC-CSS2/selector.html#adjacent-selectors */  <br /> head:first-child+body tbody[class].scrollContent td {  <br /> width: 200px  <br /> }  </p> <p>head:first-child+body tbody[class].scrollContent td + td {  <br /> width: 250px  <br /> }  </p> <p>head:first-child+body tbody[class].scrollContent td + td + td {  <br /> border-right: none;  <br /> padding: 2px 4px 2px 3px;  <br /> width: 300px  </p> <p>/* expression is for WinIE 5.x only. Remove to validate and for pure CSS solution */  <br /> top: expression(document.getElementById("tableContainer").scrollTop)  <br /> }  <br /> -->  <br /> </style>  <br /> </head><body>  <br />  <script><br />    function test() {<br />     var cH = document.getElementById("tableContainer").clientHeight;<br />     var sH = document.getElementById("tableContainer").scrollHeight;<br />     var sT = document.getElementById("tableContainer").scrollTop;<br />     alert(cH+":"+sH+":"+sT);<br />    }<br />   </script><br /> <div id="tableContainer" class="tableContainer">  <br /> <table border="0" cellpadding="0" cellspacing="0" width="100%" class="scrollTable">  <br /> <thead class="fixedHeader">  <br /> <tr>  <br /> <th><a href="#" onclick="javascript:test();">Header 1</a></th>  <br /> <th><a href="#">Header 2</a></th>  <br /> <th><a href="#">Header 3</a></th>  <br /> <th><a href="#">Header 4</a></th>  <br /> </tr>  <br /> </thead>  <br /> <tbody class="scrollContent">  <br /> <tr>  <br /> <td>Cell Content 1</td>  <br /> <td>Cell Content 2</td>  <br /> <td>Cell Content 3</td>  <br /> <td>Cell Content 4</td>  <br />  <br /> </tr>  <br /> <tr>  <br /> <td>More Cell Content 1</td>  <br /> <td>More Cell Content 2</td>  <br /> <td>More Cell Content 3</td>  <br /> <td>More Cell Content 4</td>  <br /> </tr>  <br /> <tr>  <br /> <td nowrap>Even More Cell Content 1</td>  <br /> <td nowrap>Even More Cell Content 2</td>  <br /> <td nowrap>Even More Cell Content 3</td>  <br /> <td nowrap>Even More Cell Content 4</td>  <br /> </tr>  </p> <p><tr>  <br /> <td>And Repeat 1</td>  <br /> <td>And Repeat 2</td>  <br /> <td>And Repeat 3</td>  <br /> <td>And Repeat 4</td>  </p> <p></tr>  <br /> <tr>  <br /> <td>And Repeat 1</td>  <br /> <td>And Repeat 2</td>  <br /> <td>And Repeat 3</td>  <br /> <td>And Repeat 4</td>  </p> <p></tr> <br /> <tr>  <br /> <td>And Repeat 1</td>  <br /> <td>And Repeat 2</td>  <br /> <td>And Repeat 3</td>  <br /> <td>And Repeat 4</td>  </p> <p></tr>  <br /> <tr>  <br /> <td>And Repeat 1</td>  <br /> <td>And Repeat 2</td>  <br /> <td>And Repeat 3</td>  <br /> <td>And Repeat 4</td>  </p> <p></tr>  <br /> <tr>  <br /> <td>And Repeat 1</td>  <br /> <td>And Repeat 2</td>  <br /> <td>And Repeat 3</td>  <br /> <td>And Repeat 4</td>  </p> <p></tr>  <br /> <tr>  <br /> <td>And Repeat 1</td>  <br /> <td>And Repeat 2</td>  <br /> <td>And Repeat 3</td>  <br /> <td>And Repeat 4</td>  </p> <p></tr>  <br /> <tr>  <br /> <td>And Repeat 1</td>  <br /> <td>And Repeat 2</td>  <br /> <td>And Repeat 3</td>  <br /> <td>And Repeat 4</td>  </p> <p></tr>  <br /> <tr>  <br /> <td>And Repeat 1</td>  <br /> <td>And Repeat 2</td>  <br /> <td>And Repeat 3</td>  <br /> <td>And Repeat 4</td>  </p> <p></tr>  <br /> <tr>  <br /> <td>And Repeat 1</td>  <br /> <td>And Repeat 2</td>  <br /> <td>And Repeat 3</td>  <br /> <td>And Repeat 4</td>  </p> <p></tr>  <br /> <tr>  <br /> <td>And Repeat 1</td>  <br /> <td>And Repeat 2</td>  <br /> <td>And Repeat 3</td>  <br /> <td>And Repeat 4</td>  </p> <p></tr>  <br /> <tr>  <br /> <td>And Repeat 1</td>  <br /> <td>And Repeat 2</td>  <br /> <td>And Repeat 3</td>  <br /> <td>And Repeat 4</td>  </p> <p></tr> <br /> <tr>  <br /> <td>And Repeat 1</td>  <br /> <td>And Repeat 2</td>  <br /> <td>And Repeat 3</td>  <br /> <td>And Repeat 4</td>  </p> <p></tr>  <br /> <tr>  <br /> <td>And Repeat 1</td>  <br /> <td>And Repeat 2</td>  <br /> <td>And Repeat 3</td>  <br /> <td>And Repeat 4</td>  </p> <p></tr> <br /> <tr>  <br /> <td>And Repeat 1</td>  <br /> <td>And Repeat 2</td>  <br /> <td>And Repeat 3</td>  <br /> <td>And Repeat 4</td>  </p> <p></tr>  <br /> <tr>  <br /> <td>And Repeat 1</td>  <br /> <td>And Repeat 2</td>  <br /> <td>And Repeat 3</td>  <br /> <td>And Repeat 4</td>  </p> <p></tr> <br /> <tr>  <br /> <td>And Repeat 1</td>  <br /> <td>And Repeat 2</td>  <br /> <td>And Repeat 3</td>  <br /> <td>最?7</td>  <br /> </tr>  </p> <p></tbody>  </p> <p><thead class="fixedHeader2">  <br /> <tr>  <br /> <th><a href="#">合计:</a></th>  <br /> <th colspan=6><a href="#">10000</a></th>  <br /> </tr>  <br /> </thead>  </p> <p></table>  <br /> </div>  </p> <p></body></html> </p> <img src ="http://www.aygfsteel.com/zhaochengming/aggbug/226835.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/zhaochengming/" target="_blank">helloworld2008</a> 2008-09-04 09:12 <a href="http://www.aygfsteel.com/zhaochengming/archive/2008/09/04/226835.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ajax下拉提示http://www.aygfsteel.com/zhaochengming/archive/2007/08/13/136478.htmlhelloworld2008helloworld2008Mon, 13 Aug 2007 10:56:00 GMThttp://www.aygfsteel.com/zhaochengming/archive/2007/08/13/136478.htmlhttp://www.aygfsteel.com/zhaochengming/comments/136478.htmlhttp://www.aygfsteel.com/zhaochengming/archive/2007/08/13/136478.html#Feedback0http://www.aygfsteel.com/zhaochengming/comments/commentRss/136478.htmlhttp://www.aygfsteel.com/zhaochengming/services/trackbacks/136478.htmlfunction suggest(src,confield,convalue,operation,thisObj) {
var str = thisObj.value;
var key = window.event.keyCode;
if (key == 40 || key == 38) {
   if (isNull(thisObj.value2)) {
    thisObj.value2 = thisObj.value;
   }
   var suggestDiv = document.getElementById(thisObj.name+"_suggest");
   if (!isNull(suggestDiv)) {
    var divArr = suggestDiv.childNodes;
    var hasIn = false;
    for (var i = 0; i < divArr.length; i++) {
     if(divArr[i].className == "td-across-deep") {
      hasIn = true;
      divArr[i].className = "td-across-low";
      divArr[i].style.backgroundColor = "white";
      if (key == 40) {
       if (i == divArr.length-1) {
        thisObj.value = thisObj.value2;
       } else {
        divArr[i+1].className = "td-across-deep";
        divArr[i+1].style.backgroundColor = "";
        thisObj.value = divArr[i+1].innerText;
       }
      } else if (key == 38) {
       if (i == 0) {
        thisObj.value = thisObj.value2;
       } else {
        divArr[i-1].className = "td-across-deep";
        divArr[i-1].style.backgroundColor = "";
        thisObj.value = divArr[i-1].innerText;
       }
      }
      break;
     }
    }
    if (!hasIn) {
     var i = 0;
     if (key == 38) {
      i = divArr.length-1;
      suggestDiv.scrollTop = 200;
     } else {
      suggestDiv.scrollTop = 0;
     }
     divArr[i].className = "td-across-deep";
     divArr[i].style.backgroundColor = "";
     thisObj.value = divArr[i].innerText;
    } else {
     key == 40 ? (suggestDiv.scrollTop +=17) : (suggestDiv.scrollTop -=17);
    }
    return true;
   }
}
var dbonclick = document.body.onclick
document.body.onclick = function() {
   if(!isNull(dbonclick))
    dbonclick();
   var arr = document.getElementsByTagName("div");
   if (!isNull(arr))
   for (var i = 0; i < arr.length; i++) {
    if (!isNull(arr[i].name))
    if (arr[i].name.indexOf("suggest") >= 0) {
     document.body.removeChild(arr[i]);
    }
   }
   arr = document.getElementsByTagName("iframe");
   if (!isNull(arr))
   for (var i = 0; i < arr.length; i++) {
    if (!isNull(arr[i].name))
    if (arr[i].name.indexOf("suggest") >= 0) {
     document.body.removeChild(arr[i]);
    }
   }
   thisObj.value2 = null;
}
try {
document.body.onclick();
} catch (e) {
   alert(e);
}
if (key == 13 || key ==   27 || isNull(str) || str.trim() == "" ) {
   return true;
}
var h=location.protocol+"http://"+location.host+"/";
     var pn=location.href.substring(h.length);
     pn=pn.substring(0,pn.indexOf("/"));
var records=thisObj.name.substring(thisObj.name.lastIndexOf("_")+1);
var fields = confield.split("#");
var conVal = convalue.split("#");
var confields = confield.split("#");
var con = "";
for (var i = 1; i < conVal.length; ++i) {
   var temp = "&fld"+confields[i]+"=";
   if (conVal[i].substring(0,1) == "&") {
    temp += conVal[i].substring(1);
   } else {
    var valObj = document.all["fld_abm"+parseFloat(conVal[i])+"_"+records];
    if (valObj == null) {
     valObj = document.all["fld_abm"+parseFloat(conVal[i])+"_"+1];
    }
    temp += strTrim(getObjValue(valObj));
   }
   con += temp;
}
url="/"+pn+"/FormServlet?act=getSuggest&src="+src+"&field="+confield+con;
     if (operation != null) {
      url += "&operation="+operation;
     }
while (url.indexOf("#") >=0) {
   url = url.replace("#","_");
}
     url+="&suggest="+str;
url = encodeURI(url);
var ajax = new Ajax(url,"post");
var divObj = document.all[thisObj.name+"_suggest"];
var iframeObj = document.createElement("iframe");

iframeObj.id = thisObj.name+"_suggest_iframe";
iframeObj.name = thisObj.name+"_suggest_iframe";
document.body.appendChild(iframeObj);
if (isNull(divObj)) {
   divObj = document.createElement("DIV");
}
divObj.name = thisObj.name+"_suggest";
divObj.id = thisObj.name+"_suggest";
divObj.style.border = '1px';
divObj.isOut = "true";
divObj.onmouseover = "javascript:this.isOut = 'false'";
divObj.onmouseout = "javascript:this.isOut = 'true'";
divObj.style.cursor = "hand";

document.body.appendChild(divObj);
divObj.style.position = "absolute";
ajax.setResponseFun(function(){
   var dom = ajax.getDomDoc();
   if(dom.readyState == 4) {
    var root = dom.documentElement;
    var str = "";
    if (root.childNodes.length == 0) {
     document.body.onclick();
     return true;
    }
    for(var i = 0; i < root.childNodes.length; i++) {
     str+="<div onmouseover='javascript:suggestOver(this);'";
     str+=" onmouseout='javascript:suggestOut(this);' ";
     str+=" onclick='javascript:setSearch(this.innerHTML,\""+thisObj.name+"\");' class='td-across-low' style='background-color:white;'>";
     str+=root.childNodes[i].text+"</div>";
    }
    divObj.innerHTML = str;
    divObj.style.borderBottom = '0.008cm outset ';
    divObj.style.borderRight = '0.008cm outset ';
    divObj.style.borderTop = '0.008cm outset ';
    divObj.style.borderLeft = '0.008cm outset ';
    divObj.style.overflowY = "auto";
    divObj.style.height = divObj.offsetHeight > 300 ? 300 : divObj.offsetHeight;
    var oRect = thisObj.getBoundingClientRect();
    divObj.style.left = oRect.left;
    divObj.style.top = oRect.top + 18;
    divObj.style.width = thisObj.clientWidth+2;
    try {
     var iobj = document.getElementById(thisObj.name+"_suggest_iframe");
     iobj.style.position = "absolute";
     iobj.style.left = divObj.offsetLeft;
     iobj.style.top = divObj.offsetTop;
     iobj.style.height = divObj.offsetHeight;
     iobj.style.width = divObj.offsetWidth;
    } catch(e){}
   }
});
ajax.send();
return true;
}

function suggestOver(obj) {
for(var i = 0; i < obj.parentNode.childNodes.length; i++) {
   obj.parentNode.childNodes[i].className = "td-across-low";  
   obj.parentNode.childNodes[i].style.backgroundColor = "white";
}
obj.className = "td-across-deep";
obj.style.backgroundColor = "";
}

function suggestOut(obj) {
obj.className = "td-across-low";
obj.style.backgroundColor = "white";
}

function setSearch(value,thisObjName) {
document.all[thisObjName].value = value;
try {
document.body.removeChild(document.getElementById(thisObjName+"_suggest_iframe"));
document.body.removeChild(document.getElementById(thisObjName+"_suggest"));
} catch (e){}
}

function hideSuggest(thisObj) {
var obj = document.getElementById(thisObj.name+"_suggest");
if ( isNull(obj) ) {
   return true;
} else {
   if (obj.isOut == "true") {
    document.body.removeChild(document.getElementById(obj.name+"_suggest_iframe"));
    document.body.removeChild(obj);
   }
}
return true;
}



helloworld2008 2007-08-13 18:56 发表评论
]]>
iframe调整面高度Q适合大文件的|页http://www.aygfsteel.com/zhaochengming/archive/2007/08/13/136477.htmlhelloworld2008helloworld2008Mon, 13 Aug 2007 10:55:00 GMThttp://www.aygfsteel.com/zhaochengming/archive/2007/08/13/136477.htmlhttp://www.aygfsteel.com/zhaochengming/comments/136477.htmlhttp://www.aygfsteel.com/zhaochengming/archive/2007/08/13/136477.html#Feedback0http://www.aygfsteel.com/zhaochengming/comments/commentRss/136477.htmlhttp://www.aygfsteel.com/zhaochengming/services/trackbacks/136477.html<iframe id="frameaaa"    onload="try{document.all['frameaaa'].style.height=frameaaa.document.body.scrollHeight;}catch(e){}"
scrolling="no"> </iframe>

var menuOpen = false;
function openMemo(){
    var obj = document.getElementById('frameaaa');
    if(!menuOpen) {
     obj.src = "XXX/XXX.html";
     obj.style.display="block";
     menuOpen = true;
     try {
       obj.onreadystatechange = function() {obj.fireEvent('onload');}
       } catch(e) {}
    }
}

如果没有onreadystatechangeQ小文g是适合的,大文件就不行?/p>

helloworld2008 2007-08-13 18:55 发表评论
]]>
javascript 仿msn 弹出信息 点击不隐?/title><link>http://www.aygfsteel.com/zhaochengming/archive/2007/08/13/136462.html</link><dc:creator>helloworld2008</dc:creator><author>helloworld2008</author><pubDate>Mon, 13 Aug 2007 10:42:00 GMT</pubDate><guid>http://www.aygfsteel.com/zhaochengming/archive/2007/08/13/136462.html</guid><wfw:comment>http://www.aygfsteel.com/zhaochengming/comments/136462.html</wfw:comment><comments>http://www.aygfsteel.com/zhaochengming/archive/2007/08/13/136462.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/zhaochengming/comments/commentRss/136462.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/zhaochengming/services/trackbacks/136462.html</trackback:ping><description><![CDATA[<p>/**<br>* 功能: 仿Msn信息提示<br>* @param height : 信息框的高度<br>* @param width : 信息框的宽度<br>* @param title : 信息框的标题<br>* @param innerHTML : 信息框面板显C内?攑֜<DIV></DIV>?L的HTML代码<br>* @return void <br>*/<br>function CMsnMsg(width,height,title,innerHTML) {<br>this.height = (height!=null)?height:150;<br>this.width = (width!=null)?width:200;<br>this.title = title; <br>this.innerHTML = innerHTML;<br>//以下为默认D|?可以调用对象的成员直接修?br>//信息框默认ؓ自动隐藏<br>this.autoHide = true;<br>//信息框右边的x坐标<br>this.right = screen.width - 2;<br>//信息框的左部x坐标<br>this.left = this.right - this.width;<br>//信息框的底部y坐标<br>this.bottom = screen.height;<br>//信息框的剙的y坐标<br>this.top = this.bottom - this.height;<br>//默认为没有关?br>this.close = false;<br>//默认为没有停止不?br>this.pause = false;<br>//信息框移动速度<br>this.speed = 15;<br>//正常昄需要多久的旉,然后关闭?br>this.timeout = 300;<br>//讄步长<br>this.step = 1;<br>//定时?br>this.timer = 0;<br>}</p> <p>/**<br>* CMsnMsg对象的显C方?br>*/<br>CMsnMsg.prototype.show = function() {<br>var pop = window.createPopup();<br>this.pop = pop;<br>      var str = "<DIV style='BORDER-RIGHT: #455690 1px solid; BORDER-TOP: #a6b4cf 1px solid; Z-INDEX: 99999; LEFT: 0px; BORDER-LEFT: #a6b4cf 1px solid; WIDTH: " <br>      str +=this.width + "px; BORDER-BOTTOM: #455690 1px solid; POSITION: absolute; TOP: 0px; HEIGHT: " + this.height + "px; BACKGROUND-COLOR: #c9d3f3'>"  <br>      str += "<TABLE style='BORDER-TOP: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid' cellSpacing=0 cellPadding=0 width='100%' bgColor=#cfdef4 border=0>"  <br>      str += "<TR>"  <br>      str += "<TD style='FONT-SIZE: 12px;COLOR: #0f2c8c' width=30 height=24></TD>"  <br>      str += "<TD style='PADDING-LEFT: 4px; FONT-WEIGHT: normal; FONT-SIZE: 12px; COLOR: #1f336b; PADDING-TOP: 4px' vAlign=center width='100%'>" + this.title + "</TD>"  <br>      str += "<TD style='PADDING-RIGHT: 2px; PADDING-TOP: 2px' vAlign=center align=right width=19>"  <br>      str += "<SPAN title=关闭 style='FONT-WEIGHT: bold; FONT-SIZE: 12px; CURSOR: hand; COLOR: black; MARGIN-RIGHT: 4px' id='btSysClose' >×</SPAN></TD>"  <br>      str += "</TR>"  <br>      str += "<TR>"  <br>      str += "<TD style='PADDING-RIGHT: 1px;PADDING-BOTTOM: 1px' colSpan=3 height=" + (this.height-28) + ">"  <br>      str += "<DIV style='BORDER-RIGHT: #b9c9ef 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #728eb8 1px solid; PADDING-LEFT: 8px; FONT-SIZE: 12px; PADDING-BOTTOM: 8px;";<br>      str += "BORDER-LEFT: #728eb8 1px solid; WIDTH: 100%; COLOR: #1f336b; PADDING-TOP: 8px; BORDER-BOTTOM: #b9c9ef 1px solid; HEIGHT: 100%'>"  <br>str += this.innerHTML;<br>      str += "</DIV>"  <br>      str += "</TD>"  <br>      str += "</TR>"  <br>      str += "</TABLE>"  <br>      str += "</DIV>"  <br>      pop.document.body.innerHTML = str;<br>      this.offset = 0;<br>      var me = this;<br>      pop.document.body.onmouseover = function() {me.pause = true;};<br>      pop.document.body.onmouseout = function() {me.pause = false;};<br>    <br>      var fun = function() {<br>       var x = me.left;<br>       var y = 0;<br>       var width = me.width;<br>       var height = me.height;<br>       if (me.offset > me.height) {<br>        height = me.height;<br>       } else {<br>        height = me.offset;<br>       }<br>       y = me.bottom - me.offset;<br>    if (y <= me.top) {<br>     me.timeout -= 1;<br>     if (me.timeout == 0) {<br>      window.clearInterval(me.timer);<br>      if (me.autoHide) {<br>       me.hide();<br>      }<br>     }<br>    } else {<br>     me.offset += me.step;<br>    }<br>    me.pop.show(x,y,width,height);<br>      }    <br>      this.timer = window.setInterval(fun,this.speed);<br>      var btClose = pop.document.getElementById("btSysClose");<br>      btClose.onclick = function(){  <br>          me.close = true;<br>          me.hide();<br>      }<br>}<br>/**<br>* CMsnMsg对象的关闭方?br>*/<br>CMsnMsg.prototype.hide = function() {<br>flag = true;<br>var offset = this.height>this.bottom-this.top?this.height:this.bottom-this.top;<br>var me = this;<br>if(this.timer > 0){  <br>    window.clearInterval(me.timer); <br>      }<br>      var fun = function() {<br>       if (!me.pause || me.close) {<br>        var x = me.left;<br>        var y = 0;<br>        var width = me.width;<br>        var height = 0;<br>        if (me.offset > 0) {<br>         height = me.offset;<br>        }<br>        y = me.bottom - height;<br>        if (y >= me.bottom) {<br>         window.clearInterval(me.timer);  <br>         me.pop.hide();<br>        } else {<br>         me.offset -= me.step;<br>        }<br>        me.pop.show(x,y,width,height);<br>       }     <br>      }<br>      this.timer = window.setInterval(fun,this.speed);<br>}<br>var msg = null;<br>function test() {<br>if (msg == null || !msg.pause) {<br>     msg = new CMsnMsg(300,220,"ABMpȝ提示");<br>     msg.innerHTML = "<A href='www.baidu.com'>www.baidu.com</a>"<br>     msg.show();<br>}<br>}<br>window.setInterval("test();",20000);</p> <img src ="http://www.aygfsteel.com/zhaochengming/aggbug/136462.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/zhaochengming/" target="_blank">helloworld2008</a> 2007-08-13 18:42 <a href="http://www.aygfsteel.com/zhaochengming/archive/2007/08/13/136462.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ӽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ԭ</a>| <a href="http://" target="_blank">˰</a>| <a href="http://" target="_blank">봨</a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">DZ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank">ԭ</a>| <a href="http://" target="_blank">Ϫ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ʩ</a>| <a href="http://" target="_blank">˹</a>| <a href="http://" target="_blank">ϴ</a>| <a href="http://" target="_blank">ɳ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank">̨</a>| <a href="http://" target="_blank">Ϸ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ƽ</a>| <a href="http://" target="_blank"></a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>