<?xml version="1.0" encoding="gb2312"?>
<?xml-stylesheet type="text/xsl" href="inc/rss.xsl" version="1.0"?><rss version="2.0">
<channel>
<title>Javascript教程 - 站长公社</title>
<link><![CDATA[http://zhanzhang.net.cn/]]></link>
<description><![CDATA[Javascript教程]]></description>
<language>zh-CN</language><generator>iwms.net</generator>
<image>
<title><![CDATA[站长公社]]></title>
<url>pic/logo.gif</url>
<link>http://zhanzhang.net.cn/</link>
</image>
<item>
	<title><![CDATA[如何优化JavaScript脚本的性能]]></title>
	<link><![CDATA[http://www.zhanzhang.net.cn/zhanzhang/2007-02/9089.html]]></link>
	<author><![CDATA[网络]]></author>	<pubDate>Wed, 14 Feb 2007 23:26:23 GMT</pubDate>
	<category><![CDATA[Javascript教程]]></category>	<description><![CDATA[作者：ShiningRay @ Nirvana Studio  <br/>随着网络的发展，网速和机器速度的提高，越来越多的网站用到了丰富客户端技术。而现在Ajax则是最为流行的一种方式。javascript是一种解释型语言，所以能无法达到和C/Java之类的水平，限制了它能在客户端所做的事情，为了能改进他的性能，我想基于我以前给JavaScript做过的很多测试来谈谈自己的经验，希望能帮助大家改进自己的JavaScript脚本性能。  <br/>语言层次方面<br/>循环<br/>循环是很常用的一个控制结构，大部分东西要依靠它来完成，在JavaScript中，我们可以使用for(;;),while(),for(in)三种循环，事实上，这三种循环中for(in)的效率极差，因为他需要...]]></description>
</item>
<item>
	<title><![CDATA[js技巧收集(200多个)]]></title>
	<link><![CDATA[http://www.zhanzhang.net.cn/zhanzhang/2007-02/9088.html]]></link>
	<author><![CDATA[网络]]></author>	<pubDate>Wed, 14 Feb 2007 23:26:22 GMT</pubDate>
	<category><![CDATA[Javascript教程]]></category>	<description><![CDATA[1.文本框焦点问题<br/>onBlur:当失去输入焦点后产生该事件<br/>onFocus:当输入获得焦点后，产生该文件<br/>Onchange:当文字值改变时，产生该事件<br/>Onselect:当文字加亮后，产生该文件  <br/>&lt;input type=&quot;text&quot; value=&quot;郭强&quot; onfocus=&quot;if(value==&apos;郭强&apos;) {value=&apos;&apos;}&quot; onblur=&quot;if <br/>(value==&apos;&apos;) {value=&apos;郭强&apos;}&quot;&gt;点击时文字消失，失去焦点时文字再出现  <br/>2.网页按钮的特殊颜色<br/>&lt;input type=button name=&quot;Submit1&quot; value=&quot;郭强&quot; size=10 class=s02...]]></description>
</item>
<item>
	<title><![CDATA[Js之软键盘实现(源码) ]]></title>
	<link><![CDATA[http://www.zhanzhang.net.cn/zhanzhang/2007-02/9087.html]]></link>
	<author><![CDATA[网络]]></author>	<pubDate>Wed, 14 Feb 2007 23:26:21 GMT</pubDate>
	<category><![CDATA[Javascript教程]]></category>	<description><![CDATA[&nbsp; &nbsp; 鉴于安全性的考虑，不少网站在登录输入密码时都采用了软键盘，避免一些键盘记录工具和木马对击键的捕捉。项目中也有这个需求，就分享给大家了，贴个效果图上来。。有兴趣的朋友可以收藏。。..如果觉得功能有点庞大，只需要数字小键盘的朋友，可参考代码精简。<br/>下载大键盘: http://www.cnblogs.com/Files/sccxszy/softKey.rar<br/>小键盘：http://www.cnblogs.com/Files/sccxszy/smallSoftkey.rar<br/>效果还原:Default.aspx,softkeyboard.js,softkey.CSS三个文件<br/>js代码:<br/>softkeyboard.js<br/>...]]></description>
</item>
<item>
	<title><![CDATA[JS+CSS打造可拖动的聊天窗口层]]></title>
	<link><![CDATA[http://www.zhanzhang.net.cn/zhanzhang/2007-02/9086.html]]></link>
	<author><![CDATA[网络]]></author>	<pubDate>Wed, 14 Feb 2007 23:26:20 GMT</pubDate>
	<category><![CDATA[Javascript教程]]></category>	<description><![CDATA[一个可以拖动的聊天窗口层，兼容IE和FF：   &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;  &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;  &lt;head&gt;    &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=gb2312...]]></description>
</item>
<item>
	<title><![CDATA[网页javascript精华代码集]]></title>
	<link><![CDATA[http://www.zhanzhang.net.cn/zhanzhang/2007-02/9085.html]]></link>
	<author><![CDATA[网络]]></author>	<pubDate>Wed, 14 Feb 2007 23:26:19 GMT</pubDate>
	<category><![CDATA[Javascript教程]]></category>	<description><![CDATA[【1、普通的弹出窗口】 <br/>&lt;SCRIPT LANGUAGE=javascript&gt; <br/>&lt;!-- <br/>window.open (&apos;page.html&apos;) <br/>--&gt; <br/>&lt;/SCRIPT&gt; <br/>　　&lt;!-- 和 --&gt;是对一些版本低的浏览器起作用，在这些老浏览器中不会将标签中的代码作为文本显示  <br/>出来。用单引号和双引号都可以，只是不要混用。   <br/>【2、经过设置后的弹出窗口】 <br/>&lt;SCRIPT LANGUAGE=javascript&gt; <br/>&lt;!-- <br/>window.open (&apos;page.html&apos;, &apos;newwindow&apos;, &apos;height=100,...]]></description>
</item>
<item>
	<title><![CDATA[在Javascript中使用正则表达式]]></title>
	<link><![CDATA[http://www.zhanzhang.net.cn/zhanzhang/2007-02/9084.html]]></link>
	<author><![CDATA[网络]]></author>	<pubDate>Wed, 14 Feb 2007 23:26:18 GMT</pubDate>
	<category><![CDATA[Javascript教程]]></category>	<description><![CDATA[在javascript里,有两种使用正则的方法,一是创建一个正则表达式的实例,而是使用String对象里的正则表达相关的方法.  <br/>首先是正则表达式的创建，有2种办法：  <br/>var my_regex=/[a-z]+/g; <br/>var my_regex=new (&quot;[a-z]+&quot;,&quot;g&quot;); <br/>方法<br/>exec(string),对string进行正则处理,并返回匹配结果. <br/>test(string),测试string是否含有匹配结果 <br/>字符串对象中的正则<br/>方法<br/>match(pattern) 根据pattern进行正则匹配,如果匹配到,返回匹配结果,如匹配不到返回null <br/>search(pattern) 根据patter...]]></description>
</item>
<item>
	<title><![CDATA[通过JAVAScript实现页面自适应]]></title>
	<link><![CDATA[http://www.zhanzhang.net.cn/zhanzhang/2007-02/9083.html]]></link>
	<author><![CDATA[网络]]></author>	<pubDate>Wed, 14 Feb 2007 23:26:17 GMT</pubDate>
	<category><![CDATA[Javascript教程]]></category>	<description><![CDATA[&nbsp; &nbsp; &nbsp; &nbsp; 有时候,我们可能需要象新版的Yahoo邮箱一样，让一些数据显示块可以根据页面大小进行自适应。事实并不难,但是如果单纯用CSS控制的话,往往不能完全实现我们要的效果,这时候需要借助javascript,Javascript可以让我我们实现司空见怪的自适应页面,在iSunXoft的HR开源项目就应用到.<br/>&nbsp; &nbsp; &nbsp; &nbsp; 实现原理:<br/>&nbsp; &nbsp; &nbsp;  &nbsp; 获取IE显示屏幕的宽高.确定哪些对象是绝对位置是固定的,那些是不固定的,哪些长宽是固定,然后象WI...]]></description>
</item>
<item>
	<title><![CDATA[用JavaScript实现字符串切分功能]]></title>
	<link><![CDATA[http://www.zhanzhang.net.cn/zhanzhang/2007-02/9082.html]]></link>
	<author><![CDATA[网络]]></author>	<pubDate>Wed, 14 Feb 2007 23:26:17 GMT</pubDate>
	<category><![CDATA[Javascript教程]]></category>	<description><![CDATA[以下是引...]]></description>
</item>
<item>
	<title><![CDATA[javaScript对象和属性]]></title>
	<link><![CDATA[http://www.zhanzhang.net.cn/zhanzhang/2007-02/9081.html]]></link>
	<author><![CDATA[网络]]></author>	<pubDate>Wed, 14 Feb 2007 23:26:15 GMT</pubDate>
	<category><![CDATA[Javascript教程]]></category>	<description><![CDATA[1.创建一个空对象：var o =new object();<br/>2.创建对象直接量：<br/> &nbsp; var cricle={x:0,y:0,radius:2}<br/> &nbsp; var homer={<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name:&quot;Homer Simpson&quot;,<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;...]]></description>
</item>
<item>
	<title><![CDATA[js用于树型结构级联选择]]></title>
	<link><![CDATA[http://www.zhanzhang.net.cn/zhanzhang/2007-02/9080.html]]></link>
	<author><![CDATA[网络]]></author>	<pubDate>Wed, 14 Feb 2007 23:26:15 GMT</pubDate>
	<category><![CDATA[Javascript教程]]></category>	<description><![CDATA[&lt;html&gt;  <br/>&lt;head&gt;<br/>&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=gb2312&quot;&gt;<br/>&lt;title&gt;及联选择-用于权限选择比较合适&lt;/title&gt;<br/>&lt;/head&gt;  <br/>&lt;body&gt;<br/>&lt;ul id=&quot;tree&quot;&gt;<br/>&nbsp; &nbsp; &lt;li&gt;&lt;input type=checkbox&gt;<br/>&nbsp; &nbsp; &nbsp; &nbsp; &lt;ul&gt;<br/>...]]></description>
</item>
<item>
	<title><![CDATA[javascript通过调用doPostBack回传页面]]></title>
	<link><![CDATA[http://www.zhanzhang.net.cn/zhanzhang/2007-02/9079.html]]></link>
	<author><![CDATA[网络]]></author>	<pubDate>Wed, 14 Feb 2007 23:26:14 GMT</pubDate>
	<category><![CDATA[Javascript教程]]></category>	<description><![CDATA[function pCall()<br/> {<br/>&nbsp; __doPostBack(&apos;Button1&apos;,&apos;&apos;);<br/> }  <br/>可以直接刷新页面，执行后台代码。 （控件名如果含有&quot;:&quot; ，需要预先替换为&quot;$&quot;)  <br/>即使控件设为隐藏，（如button的visible = false），页面上没有生成button, 仍然可以这样直接使用。...]]></description>
</item>
<item>
	<title><![CDATA[注意JavaScript中RegExp对象的test方法 ]]></title>
	<link><![CDATA[http://www.zhanzhang.net.cn/zhanzhang/2007-02/9078.html]]></link>
	<author><![CDATA[网络]]></author>	<pubDate>Wed, 14 Feb 2007 23:26:13 GMT</pubDate>
	<category><![CDATA[Javascript教程]]></category>	<description><![CDATA[javascript 中的 RegExp 对象用于正则表达式相关的操作，这个对象提供了一个方法 test 来判定某个字符串是否满足某个 pattern. 返回值是 true/false.<br/>今天我碰到了一个问题：  <br/>&lt;script type=&quot;text/javascript&quot;&gt;<br/>&lt;!--<br/>var re = /^\d+(?:\.\d)?$/ig;&nbsp; &nbsp;   <br/>alert(re.test(&apos;112.3&apos;));<br/>alert(re.test(&apos;33&apos;));<br/>//--&gt;<br/>&lt;/script&gt;<br/>这里两个测试的字符串应该都满足正则表达式中的模式，返回 true. 可是测试...]]></description>
</item>
<item>
	<title><![CDATA[如何用javascript判断录入的日期是否合法]]></title>
	<link><![CDATA[http://www.zhanzhang.net.cn/zhanzhang/2007-02/9077.html]]></link>
	<author><![CDATA[网络]]></author>	<pubDate>Wed, 14 Feb 2007 23:26:12 GMT</pubDate>
	<category><![CDATA[Javascript教程]]></category>	<description><![CDATA[如何用javascript判断录入的日期是否合法  <br/>function IsValidYear(psYear)<br/>{<br/>&nbsp; &nbsp; var sYear = new String(psYear);  <br/>&nbsp; &nbsp; if(psYear==null)<br/>&nbsp; &nbsp; {<br/>&nbsp; &nbsp; &nbsp; &nbsp; return false;<br/>&nbsp; &nbsp; }  <br/>&nbsp; &nbsp; if(isNaN(psYear)==true)<br/>&nbsp;...]]></description>
</item>
<item>
	<title><![CDATA[如何用javascript防止连打（双击） ]]></title>
	<link><![CDATA[http://www.zhanzhang.net.cn/zhanzhang/2007-02/9076.html]]></link>
	<author><![CDATA[网络]]></author>	<pubDate>Wed, 14 Feb 2007 23:26:10 GMT</pubDate>
	<category><![CDATA[Javascript教程]]></category>	<description><![CDATA[javascript代码：<br/>function doubleCheck(){<br/>&nbsp; &nbsp; if (window.document.readyState != null &&<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; window.document.readyState != &apos;complete&apos;)<br/>&nbsp; &nbsp; {<br/>&nbsp; &nbsp; &nbsp; &nbsp; alert(&quot;正在处理，请等待！&quot;);<br/>&nbsp; &nbsp;...]]></description>
</item>
<item>
	<title><![CDATA[关于ie的内存泄漏与javascript内存释放]]></title>
	<link><![CDATA[http://www.zhanzhang.net.cn/zhanzhang/2007-02/9075.html]]></link>
	<author><![CDATA[网络]]></author>	<pubDate>Wed, 14 Feb 2007 23:26:09 GMT</pubDate>
	<category><![CDATA[Javascript教程]]></category>	<description><![CDATA[&nbsp;  &nbsp; 最近做一个公司的业务系统，公司要求能尽可能的与c/s近似，也就是如c/s一样，点击文本框可以弹出此项目的相关内容，进行选择输入。<br/>&nbsp;  &nbsp; 我使用了弹出窗口，然后在子窗口双击选中项目，把选中的值返回给父窗体。<br/>&nbsp;  &nbsp; 在系统做完了之后，在客户使用的过程，由于客户使用的是512m的内存配置，所以在打开了30--40个窗体之后，ie的虚拟内存占用量达到近200m，从而使系统变慢，javascript的运行也变慢了。  <br/>&nbsp; &nbsp; &nbsp; 在google搜了一下之后，才知道可能是由于ie的内存泄...]]></description>
</item>
<item>
	<title><![CDATA[javascript实现划词标记划词搜索功能]]></title>
	<link><![CDATA[http://www.zhanzhang.net.cn/zhanzhang/2007-02/9074.html]]></link>
	<author><![CDATA[网络]]></author>	<pubDate>Wed, 14 Feb 2007 23:26:08 GMT</pubDate>
	<category><![CDATA[Javascript教程]]></category>	<description><![CDATA[完整示例代码如下：  <br/>以下是引用片段：<br/>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&gt; <br/>&lt;html&gt; <br/>&lt;head&gt; <br/>&lt;title&gt;Untitled Document&lt;/title&gt; <br/>&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=gb2312&quot;&gt; <br/>&lt;/head&gt; <br/>&lt;body&gt;   <br/>&lt;SCRIPT language=javascript&gt; <br/>...]]></description>
</item>
<item>
	<title><![CDATA[javascript实现datagrid客户端checkbox列的全选,反选]]></title>
	<link><![CDATA[http://www.zhanzhang.net.cn/zhanzhang/2007-02/9073.html]]></link>
	<author><![CDATA[网络]]></author>	<pubDate>Wed, 14 Feb 2007 23:26:05 GMT</pubDate>
	<category><![CDATA[Javascript教程]]></category>	<description><![CDATA[最简格式：这是一个偷巧的方法，但不通用。前提是这个页面只有一个datagrid，且只有datagrid中有checkbox；这个就比较方便。主要思路就是搜索出整个页面的checkbox，将它们全部选中或反选。 <br/>// 全选 <br/>function allCheck() <br/>{ <br/>for (var i=0;i&lt;Form1.elements.length;i++) <br/>{ <br/>var e=Form1.elements[i]; <br/>if (e.type==&apos;checkbox&apos;) <br/>e.checked=true; <br/>}   <br/>} <br/>//反选 <br/>function revCheck() <br/>{ <br/>for (var i...]]></description>
</item>
<item>
	<title><![CDATA[用于自动添加Digg This!按钮的JavaScript]]></title>
	<link><![CDATA[http://www.zhanzhang.net.cn/zhanzhang/2007-02/9072.html]]></link>
	<author><![CDATA[网络]]></author>	<pubDate>Wed, 14 Feb 2007 23:26:04 GMT</pubDate>
	<category><![CDATA[Javascript教程]]></category>	<description><![CDATA[var main=document.getElementById(&quot;main&quot;);<br/>var singlepost=false;<br/>var firstpost;<br/>var anchor;<br/>for(var i=0;i&lt;main.childNodes.length;i++)<br/>{<br/>&nbsp; if(main.childNodes[i].className&&main.childNodes[i].className==&quot;post&quot;)<br/>&nbsp; {<br/>&nbsp; &nbsp; var post=main.childNodes[i];<br/>&nbsp; &nbsp; if(!firstpost)<br/>...]]></description>
</item>
<item>
	<title><![CDATA[用Javascript轻松制作一套简单的抽奖系统]]></title>
	<link><![CDATA[http://www.zhanzhang.net.cn/zhanzhang/2007-02/9071.html]]></link>
	<author><![CDATA[网络]]></author>	<pubDate>Wed, 14 Feb 2007 23:26:03 GMT</pubDate>
	<category><![CDATA[Javascript教程]]></category>	<description><![CDATA[&nbsp; &nbsp; 作者：jegg <br/>　　年底将至，许多公司忙着搞年会，会上一般都会有一些抽奖活动，下面的程序就是用javascript 写的一个简单的抽奖系统与大家共享。  <br/>　　此代码借鉴了网上的一些网友的代码，又加上了一些诸如不重复抽奖之类的改进。大概思路如下：  <br/>　　1.将所有的的抽奖数据（这里为手机号码）存入数组中。<br/>　　2.使用random 函数随机产生该数组的INDEX<br/>　　3.使用setInterval 函数以极短的时间间隔产生该数组随机INDEX所对应的手机号码，并显示。<br/>　　4.使用removeEleAt（index）函数删除随机产生过的手机号码。并且重新组织生成剩余的手机号码为一个新的数组，为下次...]]></description>
</item>
<item>
	<title><![CDATA[用javascript的ShowModalDialog()函数去显示一个aspx页面时缓存的问题]]></title>
	<link><![CDATA[http://www.zhanzhang.net.cn/zhanzhang/2007-02/9070.html]]></link>
	<author><![CDATA[网络]]></author>	<pubDate>Wed, 14 Feb 2007 23:26:02 GMT</pubDate>
	<category><![CDATA[Javascript教程]]></category>	<description><![CDATA[用javascript的ShowModalDialog()函数去显示一个aspx页面时，存在缓存的问题，第一次ShowModalDialog的时候看到的是正常的内容，而第二次开始看到的页面内容则都是第一次看的内容，也就是说页面是直接从缓存里面得到的，而不是去服务器取，而我的程序里面都没有让这个页面永远的缓存<br/>两个解决办法:<br/>方法一：先写一个htm页面，里面嵌套一个iframe,iframe的src就是aspx页面，然后ShowModalDialog()的页面就是这个htm页面，而不是先前的aspx页面，这样就不存在缓存问题。<br/>&nbsp; &nbsp; 方法二：在aspx页面的Page_load()里面写上一句 Response.expires = -1; 意思就...]]></description>
</item>
</channel>
</rss>