<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Javascript &#8211; LPC影子技术分享</title>
	<atom:link href="https://www.mudbest.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.mudbest.com</link>
	<description>行影不离,忘之却步.</description>
	<lastBuildDate>Wed, 27 Feb 2013 06:28:24 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.2</generator>
	<item>
		<title>Javascript简体转繁体(想起某天某人的问题)</title>
		<link>https://www.mudbest.com/javascript%e7%ae%80%e4%bd%93%e8%bd%ac%e7%b9%81%e4%bd%93%e6%83%b3%e8%b5%b7%e6%9f%90%e5%a4%a9%e6%9f%90%e4%ba%ba%e7%9a%84%e9%97%ae%e9%a2%98/</link>
		
		<dc:creator><![CDATA[hkshadow]]></dc:creator>
		<pubDate>Wed, 27 Feb 2013 06:03:02 +0000</pubDate>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[下载]]></category>
		<category><![CDATA[简繁转换]]></category>
		<guid isPermaLink="false">http://www.mudbest.com/?p=1777</guid>

					<description><![CDATA[简体转繁体其实方法很多，其中最为简单的就是字库对照的方式，如同2个数组的指针对应上，可是有人说怎么转换词组呢？ ... <a title="Javascript简体转繁体(想起某天某人的问题)" class="read-more" href="https://www.mudbest.com/javascript%e7%ae%80%e4%bd%93%e8%bd%ac%e7%b9%81%e4%bd%93%e6%83%b3%e8%b5%b7%e6%9f%90%e5%a4%a9%e6%9f%90%e4%ba%ba%e7%9a%84%e9%97%ae%e9%a2%98/" aria-label="阅读 Javascript简体转繁体(想起某天某人的问题)">阅读更多</a>]]></description>
										<content:encoded><![CDATA[<p>简体转繁体其实方法很多，其中最为简单的就是字库对照的方式，如同2个数组的指针对应上，可是有人说怎么转换词组呢？别看词组什么的，只需要看它每个字，然后查找出每个字的对应字库即可。</p>
<p>如：<br />
code:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
$arr1 = array('我','你','他');
$arr2 = array('他','我','她');
?&gt;
</pre>
<p>当我进行转换的时候，其实就是将数组$arr1其中的值替换为了$arr2的值，最后的结果结果就是转换的结果。</p>
<p>例子说了，下面来实际的应用吧<span id="more-1777"></span>。</p>
<p>首先下载字库类：</p>
<p><a href="http://www.mudbest.com/javascript%e7%ae%80%e4%bd%93%e8%bd%ac%e7%b9%81%e4%bd%93%e6%83%b3%e8%b5%b7%e6%9f%90%e5%a4%a9%e6%9f%90%e4%ba%ba%e7%9a%84%e9%97%ae%e9%a2%98/tw_cn-2/" rel="attachment wp-att-1778">tw_cn</a></p>
<p>然后在demo页面里写入以下代码：</p>
<p>code:</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot; src=&quot;tw_cn.js&quot;&gt;&lt;/script&gt;  &lt;!--引入这个类库--&gt;
&lt;a id=&quot;translateLink&quot;&gt;&lt;/a&gt;  &lt;!--这个必须要带上，用于切换状态的按钮显示--&gt;
&lt;script type=&quot;text/javascript&quot;&gt;  
var msgToTraditionalChinese = &quot;&quot;; //初始化
var msgToSimplifiedChinese = &quot;&quot;; //初始化
translateInitilization(); //执行函数
&lt;/Script&gt;
</pre>
<p>可能以上代码看的不是很明白，那么看下字库这个类：</p>
<pre class="brush: jscript; title: ; notranslate">
var defaultEncoding = 2; // 1: 繁体, 2: 简体
var translateDelay = 0;
//var cookieDomain = &quot;http://www.mudbest.com&quot;; //生效域名，这里不作处理，直接注释
var msgToTraditionalChinese = &quot;繁體&quot;; //按钮切换后显示的内容
var msgToSimplifiedChinese = &quot;简体&quot;;  //按钮切换后显示的内容
var translateButtonId = &quot;translateLink&quot;;  //&lt;a id=&quot;translateLink&quot;&gt;&lt;/a&gt; 也就是这段要用到的

var currentEncoding = defaultEncoding;
//var targetEncodingCookie = &quot;targetEncoding&quot; + cookieDomain.replace(/\./g,&quot;&quot;);
//最终将简繁的状态存储在cookie里，cookie为&quot;think_language&quot;，即便是关掉浏览器，下次打开后依然会记录到
var targetEncodingCookie = &quot;think_language&quot;; 
var targetEncoding = ( getCookie(targetEncodingCookie) == null ? defaultEncoding : getCookie(targetEncodingCookie) );
var translateButtonObject;
//……剩下的就不一一解释了，主题流程已走完，剩下的就是字库替换了，有耐心的请自己接着看下去吧。
</pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Javascript的Attribute和setAttribute</title>
		<link>https://www.mudbest.com/javascript%e7%9a%84attribute%e5%92%8csetattribute/</link>
		
		<dc:creator><![CDATA[hkshadow]]></dc:creator>
		<pubDate>Thu, 24 Jan 2013 07:19:06 +0000</pubDate>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Attribute]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[setAttribute]]></category>
		<guid isPermaLink="false">http://www.mudbest.com/?p=1758</guid>

					<description><![CDATA[首先讲讲setAttribute，我们经常需要在JavaScript中给Element动态添加各种属性，这可以 ... <a title="Javascript的Attribute和setAttribute" class="read-more" href="https://www.mudbest.com/javascript%e7%9a%84attribute%e5%92%8csetattribute/" aria-label="阅读 Javascript的Attribute和setAttribute">阅读更多</a>]]></description>
										<content:encoded><![CDATA[<p>首先讲讲setAttribute，我们经常需要在JavaScript中给Element动态添加各种属性，这可以通过使用setAttribute()来实现，这就涉及到了浏览器的兼容性问题。</p>
<pre class="brush: jscript; title: ; notranslate">
setAttribute(string name, string value)：
</pre>
<p>//增加一个指定名称和值的新属性，或者把一个现有的属性设定为指定的值。</p>
<p>1、样式问题<br />
setAttribute(&#8220;class&#8221;, value)中class是指改变&#8221;class&#8221;这个属性，所以要带引号。<br />
vName代表对样式赋值。<span id="more-1758"></span><br />
例如:</p>
<pre class="brush: jscript; title: ; notranslate">
var input = document.createElement(&quot;input&quot;);
input.setAttribute(&quot;type&quot;, &quot;text&quot;);
input.setAttribute(&quot;name&quot;, &quot;q&quot;);
input.setAttribute(&quot;class&quot;,bordercss);
</pre>
<p>输出时： ,即，input控件具有bordercss样式属性<br />
注意：class属性在W3C DOM中扮演着很重要的角色，但由于浏览器差异性仍然存在。<br />
使用setAttribute(&#8220;class&#8221;, vName)语句动态设置Element的class属性在firefox中是行的通的，但在IE中却不行。因为使用IE内核的浏览器不认识&#8221;class&#8221;，要改用&#8221;className&#8221;；<br />
同样，firefox 也不认识&#8221;className&#8221;。所以常用的方法是二者兼备：</p>
<pre class="brush: jscript; title: ; notranslate">
element.setAttribute(&quot;class&quot;, value); //for firefox
element.setAttribute(&quot;className&quot;, value); //for IE
</pre>
<p>2、方法属性等问题<br />
例如：<br />
var bar = document.getElementById(&#8220;testbt&#8221;);<br />
bar.setAttribute(&#8220;onclick&#8221;, &#8220;javascript:alert(&#8216;This is a test!&#8217;);&#8221;);<br />
这里利用setAttribute指定e的onclick属性，简单，很好理解。<br />
但是IE不支持，IE并不是不支持setAttribute这个函数，而是不支持用setAttribute设置某些属性，例如对象属性、集合属性、事件属性，也就是说用setAttribute设置style和onclick这些属性在IE中是行不通的。</p>
<p>为达到兼容各种浏览器的效果，可以用点符号法来设置Element的对象属性、集合属性和事件属性。</p>
<pre class="brush: jscript; title: ; notranslate">
document.getElementById(&quot;testbt&quot;).className = &quot;bordercss&quot;;
document.getElementById(&quot;testbt&quot;).style.cssText = &quot;color: #00f;&quot;;
document.getElementById(&quot;testbt&quot;).style.color = &quot;#00f&quot;;
document.getElementById(&quot;testbt&quot;).onclick= function () { alert(&quot;This is a test!&quot;); }
</pre>
<p>由此延伸的问题:</p>
<p>一个input的text,当将html赋值为某个div的innerHTML时,遇到一个现象,当在firefox下时(IE下不存在此问题),赋值后的innerHTML里不含有value,即当你在文本框输入内容后,<br />
你想将</p>
<pre class="brush: xml; title: ; notranslate">
&lt;input type=text name=input1 value=”aa”&gt;
</pre>
<p>赋值给div时,只会得到</p>
<pre class="brush: xml; title: ; notranslate">
&lt;input type=text name=input1&gt;
</pre>
<p>这里总是会将value清除.</p>
<p>这时,setAttribute起作用了,在input内加上:onkeyup=&#8221;this.setAttribute(&#8216;value&#8217;,this.value)&#8221;,即动态的将input控件加上value值,这时再将文本框赋值给div,value将不会被清空.</p>
<p>而对于Attribute一般可用来获取属性的值，例如</p>
<pre class="brush: jscript; title: ; notranslate">
document.getElementById(&quot;testbt&quot;).Attribute&#x5B;'src'].value;
</pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Javascript的setInterval和clearInterval应用</title>
		<link>https://www.mudbest.com/javascript%e7%9a%84setinterval%e5%92%8cclearinterval%e5%ba%94%e7%94%a8/</link>
		
		<dc:creator><![CDATA[hkshadow]]></dc:creator>
		<pubDate>Tue, 22 Jan 2013 06:17:43 +0000</pubDate>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[分享]]></category>
		<category><![CDATA[clearInterval]]></category>
		<category><![CDATA[setInterval]]></category>
		<category><![CDATA[倒计时]]></category>
		<guid isPermaLink="false">http://www.mudbest.com/?p=1753</guid>

					<description><![CDATA[时间间隔可以用 setInterval 命令来创建并用 clearInterval 命令来终止。setInte ... <a title="Javascript的setInterval和clearInterval应用" class="read-more" href="https://www.mudbest.com/javascript%e7%9a%84setinterval%e5%92%8cclearinterval%e5%ba%94%e7%94%a8/" aria-label="阅读 Javascript的setInterval和clearInterval应用">阅读更多</a>]]></description>
										<content:encoded><![CDATA[<p>时间间隔可以用 setInterval 命令来创建并用 clearInterval 命令来终止。setInterval 所用的参数有两种格式。在第一种格式中，你传递给 setInterval 的参数可以是一个函数名，一段时间上的间隔以及一些传递给前面函数的相关参数。当 setInterval 运行时它会依照规定的时间间隔依次将列出的参数传递给指定的函数，直到你调用 clearInterval 将其终止。相关的示范代码<span id="more-1753"></span>如下： </p>
<pre class="brush: jscript; title: ; notranslate">
function updateStockPrices(whichStock) { 
    // Update code here 
    trace('Updating prices for '+whichStock); 
} 
stockInterval = setInterval(updateStockPrices, 1000, &quot;Stratford Flash Products&quot;);
</pre>
<p>setInterval全面的介绍<br />
setInterval动作的作用是在播放动画的时，每隔一定时间就调用函数，方法或对象。可以使用本动作更新来自数据库的变量或更新时间显示。setInterval动作的语法格式如下： </p>
<p>setInterval(function,interval[,arg1,arg2,&#8230;&#8230;argn])<br />
setInterval(object,methodName,interval[,arg1,arg2,&#8230;..argn]) </p>
<p>第一种格式是标准动作面板中setInterval函数的默认语法，第二种格式是在专家模式动作中使用的方法。<br />
其中的参数function是一个函数名或者一个对匿名函数的引用。object参数指定从Object对象派生的对象。methodName制定object参数中要调用的方法。interval制定对function或methodName调用两次之间的时间，单位是毫秒。后面的arg1等是可选的参数，用于制定传递给function或是methodName的参数。<br />
setInterval它设置的时间间隔小于动画帧速（如每秒10帧，相当于100毫秒），则按照尽可能接近interval的时间间隔调用函数。而且必须使用updateAfterEvent动作来确保以足够的频率刷新屏幕。如果interval大于动画帧速，则只用在每次播放头进入某一帧是才调用，以减小每次刷新屏幕的影响。<br />
下面的例子每隔1秒调用一次匿名函数。 </p>
<p>setInterval(function(){trace(&#8220;每隔1秒钟我就会显示一次&#8221;)},1000);//这里的function(){}是没有函数名<br />
的函数。成为匿名函数，后面的1000是时间间隔，单位是毫秒。<br />
下面的例子为我们展示如何带参数运行。 </p>
<pre class="brush: jscript; title: ; notranslate">
function show1(){ 
    trace(&quot;每隔1秒我就会显示一次&quot;); 
} 
function show2(str){ 
    trace(str); 
} 
setInterval(show1,1000); 
</pre>
<p>setInterval(show2,2000,&#8221;每隔2秒我就会显示一次&#8221;);<br />
上面已经将函数的setInterval方法介绍了。<br />
下面我们将介绍对象的setInterval方法。<br />
首先，写一个setInterval在动作中调用对象的方法的例子，该例子不需要传递参数。 </p>
<pre class="brush: jscript; title: ; notranslate">
myobj=new Object();//创建一个新的对象 
myobj.interval=function){ 
trace(&quot;每隔1秒我就会显示一次&quot;); 
}//创建对象的方法。 
setInterval(myobj,&quot;interval&quot;,1000);//设定时间间隔调用对象的方法。 
</pre>
<p>接下来介绍如何传递参数。其实道理和函数的传递参数是一样的。 </p>
<pre class="brush: jscript; title: ; notranslate">
myobj=new Object(); 
myobj.interval-function(str){ 
    trace(str); 
} 
setInterval(myobj,&quot;interval&quot;,2000,&quot; 每隔2秒我就会显示一次&quot;); 
</pre>
<p>注意。要调用为对象定义的方法时，必须在专家模式中使用第二种语法格式。<br />
这样子的话呢，我们来作一个动态显示时间的画面。可以用下面的代码实现。 </p>
<pre class="brush: jscript; title: ; notranslate">
setInterval(show,1000); 
function show(){ 
    time=new Date(); 
    hour=time.getHours(); 
    minu=time.getMinutes(); 
    sec=time.get.Seconds(); 
    datetime=hour &quot;:&quot; minu &quot;:&quot; sec; 
}
//这里的datetime是一个动态文本框的变量名字。 
</pre>
<p>这样子呢，setInterval这个方法大家应该学的很好了。现在呢，我们学习clearInterval.<br />
clearInterval动作的作用是清楚对setInterval函数的调用，它的语法格式如下clearInterval(intervalid);intervalid是调用setInterval函数后返回的对象。<br />
下面举一个简单的例子。 </p>
<pre class="brush: jscript; title: ; notranslate">
function show(){ 
    trace(&quot;每隔一秒我就会显示一次&quot;); 
} 
var sh; 
sh=setInterval(show,1000); 
clearInterval(sh); 
</pre>
<p>JS Demo:</p>
<pre class="brush: jscript; title: ; notranslate">
function auto(){ 
alert(&quot;到時間了&quot;) 
} 
var monitorInterval = null;  
function setAuto(time,isFrist){ 
    var intervalTime=time; 
        if(isFrist!=&quot;1&quot;){ 
            if(intervalTime!=&quot;off&quot;){ 
                monitorInterval= setInterval(&quot;auto()&quot;, intervalTime*1000); 
            }else{ 
            if(monitorInterval){    
                clearInterval(monitorInterval); 
                monitorInterval = null; 
            } 
        } 
    } 
} 
</pre>
<p>Html Demo:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;table&gt; 
&lt;tr&gt; 
&lt;td nowrap=&quot;nowrap&quot; bgcolor=&quot;#E8E8E8&quot;&gt;自動更新&lt;/td&gt; 
&lt;td align=&quot;left&quot; bgcolor=&quot;#E8E8E8&quot;&gt;&lt;select 
onchange=&quot;setAuto(this.value,'0')&quot;&gt; 
&lt;option value=&quot;10&quot;&gt;10sec&lt;/option&gt; 
&lt;option value=&quot;20&quot;&gt;20sec&lt;/option&gt; 
&lt;option value=&quot;30&quot;&gt;30sec&lt;/option&gt; 
&lt;option value=&quot;60&quot;&gt;1min&lt;/option&gt; 
&lt;option value=&quot;300&quot;&gt;5min&lt;/option&gt; 
&lt;option value=&quot;600&quot;&gt;10min&lt;/option&gt; 
&lt;option value=&quot;1800&quot;&gt;30min&lt;/option&gt; 
&lt;option value=&quot;3600&quot;&gt;60min&lt;/option&gt; 
&lt;option value=&quot;off&quot;&gt;Stay&lt;/option&gt; 
&lt;/select&gt;&lt;/td&gt; 
&lt;/tr&gt; 
&lt;/table&gt;
</pre>
<p>另一片文章也讲到了setInterval和clearInterval。</p>
<blockquote class="wp-embedded-content" data-secret="mxjtGy9BkW"><p><a href="https://www.mudbest.com/js%e7%ae%80%e5%8d%95%e5%ae%9e%e7%8e%b0%e6%97%b6%e9%97%b4%e6%a0%bc%e5%bc%8f%e5%80%92%e8%ae%a1%e6%97%b6/">js简单实现时间格式倒计时</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="《js简单实现时间格式倒计时》—影子" src="https://www.mudbest.com/js%e7%ae%80%e5%8d%95%e5%ae%9e%e7%8e%b0%e6%97%b6%e9%97%b4%e6%a0%bc%e5%bc%8f%e5%80%92%e8%ae%a1%e6%97%b6/embed/#?secret=mxjtGy9BkW" data-secret="mxjtGy9BkW" width="600" height="338" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>js下数组相同值过滤函数</title>
		<link>https://www.mudbest.com/js%e4%b8%8b%e6%95%b0%e7%bb%84%e7%9b%b8%e5%90%8c%e5%80%bc%e8%bf%87%e6%bb%a4%e5%87%bd%e6%95%b0/</link>
		
		<dc:creator><![CDATA[hkshadow]]></dc:creator>
		<pubDate>Fri, 23 Nov 2012 07:53:19 +0000</pubDate>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[数组]]></category>
		<category><![CDATA[过滤]]></category>
		<category><![CDATA[重复值]]></category>
		<guid isPermaLink="false">http://www.mudbest.com/?p=1705</guid>

					<description><![CDATA[相对PHP来说，JS数组下的相同值就需要一一对比，然后取空而达到相同的值只显示一次的效果，下面这个函数即可将数 ... <a title="js下数组相同值过滤函数" class="read-more" href="https://www.mudbest.com/js%e4%b8%8b%e6%95%b0%e7%bb%84%e7%9b%b8%e5%90%8c%e5%80%bc%e8%bf%87%e6%bb%a4%e5%87%bd%e6%95%b0/" aria-label="阅读 js下数组相同值过滤函数">阅读更多</a>]]></description>
										<content:encoded><![CDATA[<p>相对PHP来说，JS数组下的相同值就需要一一对比，然后取空而达到相同的值只显示一次的效果，下面这个函数即可将数组中相同的值过滤掉，并返回未包含重复值的数组。<span id="more-1705"></span></p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot;&gt;
function filterArray(array){
	var key = 0; //初始化键值
	var arr = new Array(); //声明一个数组
	var num = array.length; //数组长度
	for(var i = 0 ;i &lt; num;i++){ //对数组进行交叉对比
	 //当对重复的值对比时，避免对比当前自己，需要在当前的基础上+1，比如array&#x5B;0],array&#x5B;1],如果对比array&#x5B;0]的时候并不是拿自身array&#x5B;0]，而是array&#x5B;1]
		for(var j = i+1;j &lt; num;j++){ 
			if(array&#x5B;i] == array&#x5B;j]){ //将交叉的数组对比
				array&#x5B;i] = null; //如果相等则 unset
				break; //并跳出
			}	
		}
	}
	
	for(var i = 0;i&lt;num;i++){  //将数组进行for遍历
		if(array&#x5B;i]){ //判断是否为空
			arr&#x5B;key++] = array&#x5B;i]; //将过滤后的数组给新数组arr赋值
		}
	}
	return arr;
}	
&lt;/script&gt;
</pre>
<p>demo:</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot;&gt;
var arrDemo = new Array(1,2,1,1,4,6,7,1,2,6,11,21,11);
console.log(filterArray(arrDemo));
alert(filterArray(arrDemo));
&lt;/script&gt;
</pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Javascript繁简转换插件应用方法</title>
		<link>https://www.mudbest.com/javascript%e7%b9%81%e7%ae%80%e8%bd%ac%e6%8d%a2%e6%8f%92%e4%bb%b6%e5%ba%94%e7%94%a8%e6%96%b9%e6%b3%95/</link>
					<comments>https://www.mudbest.com/javascript%e7%b9%81%e7%ae%80%e8%bd%ac%e6%8d%a2%e6%8f%92%e4%bb%b6%e5%ba%94%e7%94%a8%e6%96%b9%e6%b3%95/#comments</comments>
		
		<dc:creator><![CDATA[hkshadow]]></dc:creator>
		<pubDate>Mon, 09 Apr 2012 03:31:11 +0000</pubDate>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[分享]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[简体]]></category>
		<category><![CDATA[繁体]]></category>
		<category><![CDATA[语言切换]]></category>
		<guid isPermaLink="false">http://www.mudbest.com/?p=1025</guid>

					<description><![CDATA[这个插件的原理就是将所选择的语言类型以COOKIE的方式存储到本地，首先必须保证浏览器支持COOKIE，否则都 ... <a title="Javascript繁简转换插件应用方法" class="read-more" href="https://www.mudbest.com/javascript%e7%b9%81%e7%ae%80%e8%bd%ac%e6%8d%a2%e6%8f%92%e4%bb%b6%e5%ba%94%e7%94%a8%e6%96%b9%e6%b3%95/" aria-label="阅读 Javascript繁简转换插件应用方法">阅读更多</a>]]></description>
										<content:encoded><![CDATA[<p>这个插件的原理就是将所选择的语言类型以COOKIE的方式存储到本地，首先必须保证浏览器支持COOKIE，否则都是浮云了。</p>
<p>COOKIE的格式：<br />
targetEncoding + cookieDomain</p>
<p>自己看着怎么灵活运用就怎么用吧，如果还有英文的翻译的话，那就需要改造了，这里只演示 简体 和 繁体之间的互相转换。<br />
当用户选择了简体，在不清空COOKIE的情况下，下一次依然是中文。<span id="more-1025"></span></p>
<p>在要放语言切换按钮的地方加入以下html代码</p>
<pre class="brush: xml; title: ; notranslate">
&lt;a id=&quot;translateLink&quot;&gt;&#x5B;简体]&lt;/a&gt;
</pre>
<p>在BODY的最下方，最好是写在FOOTE下面，有很多人都是放在了头部，导致无法正常使用甚至无法使用。<br />
处理COOKIE：</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php if (strtoupper(substr($_SERVER&#x5B;&quot;HTTP_ACCEPT_LANGUAGE&quot;],0,5)) == &quot;ZH-CN&quot;)  : ?&gt;
var targetEncoding = ( getCookie(targetEncodingCookie) == null ? 2 : getCookie(targetEncodingCookie) );
&lt;?php else: ?&gt;
var targetEncoding = ( getCookie(targetEncodingCookie) == null ? defaultEncoding : getCookie(targetEncodingCookie) );
&lt;?php endif; ?&gt;
var cookieDomain = &quot;http://www.mudbest.com&quot;;
translateInitilization(); //执行
</pre>
<p>接下来自己开始灵活运用吧。</p>
<p>JS插件包：<br />
<a href='http://www.mudbest.com/1025.action/tw_cn' rel='attachment wp-att-1026' target="__blank">tw_cn</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.mudbest.com/javascript%e7%b9%81%e7%ae%80%e8%bd%ac%e6%8d%a2%e6%8f%92%e4%bb%b6%e5%ba%94%e7%94%a8%e6%96%b9%e6%b3%95/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>ControlJS简单应用介绍</title>
		<link>https://www.mudbest.com/controljs%e7%ae%80%e5%8d%95%e5%ba%94%e7%94%a8%e4%bb%8b%e7%bb%8d/</link>
					<comments>https://www.mudbest.com/controljs%e7%ae%80%e5%8d%95%e5%ba%94%e7%94%a8%e4%bb%8b%e7%bb%8d/#comments</comments>
		
		<dc:creator><![CDATA[hkshadow]]></dc:creator>
		<pubDate>Fri, 16 Mar 2012 05:45:46 +0000</pubDate>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[ControlJS]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<guid isPermaLink="false">http://www.mudbest.com/?p=954</guid>

					<description><![CDATA[Steve Souders 最近做了这么一个东西—— ControllJs。 主要为了是解决网页加载中Js文件 ... <a title="ControlJS简单应用介绍" class="read-more" href="https://www.mudbest.com/controljs%e7%ae%80%e5%8d%95%e5%ba%94%e7%94%a8%e4%bb%8b%e7%bb%8d/" aria-label="阅读 ControlJS简单应用介绍">阅读更多</a>]]></description>
										<content:encoded><![CDATA[<p>Steve Souders 最近做了这么一个东西—— ControllJs。 主要为了是解决网页加载中Js文件的性能问题。这里做一个简单的转述。</p>
<p>众所周知，资源文件在浏览器加载直至用户可用是有两个阶段的：加载，执行。JavaScript的加载会阻滞其他资源的加载，而由于浏览器渲染是单线程的，JS执行的同时浏览器实际是假死状态的，页面渲染会停止，浏览器也不会下载新的文件。这样也会造成很大的性能问题， 所以Steve提出了三个方法：异步加载；延迟执行；覆写document.write。<br />
<strong><br />
1. 异步加载</strong><br />
核心思想还是很简单：让页面中的js片段对浏览器不可识别。jquery的template也是用了类似的方法。</p>
<p>外链脚本：由</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot; src=&quot;main.js&quot;&gt;&lt;script&gt; 
</pre>
<p><span id="more-954"></span><br />
改写成</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/cjs&quot; src=&quot;main.js&quot;&gt;&lt;script&gt; 
</pre>
<p>内联脚本：由</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;sth...&lt;script&gt;
</pre>
<p>改写成</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/cjs&quot;&gt;sth...&lt;script&gt; 
</pre>
<p>这样子的type声明，浏览器是识别不了的，也不会去加载，更不会执行非ie浏览器不会加载，ie浏览器会加载这个文件，但所有都不会执行内部脚本。</p>
<p>接下来，对于外链的脚本，取出所有的src属性，通过Image或Object元素加载进页面（可参考css,javascript的预加载）。 这样加载的文件不会执行，节省了js的执行时间。</p>
<p>Gmail团队使用了另外一种方法，内联的js全部都放在/*&#8230;*/的注释中。也是可以参考的一种方法。</p>
<p>对于没有其他处理的脚本，ControlJS将在window.onload之后执行。对于外链重新创建一个正常的script运行，对于内联则直接eval。如果需要延迟，则需要采取下面的防范。</p>
<p><strong>2. 延迟执行</strong></p>
<p>正如前面说的，JS的执行也会带来大量性能问题。而据统计，一个页面只有29%的脚本是对于页面渲染，逻辑执行等有关系的，其余71%都是在页面加载之后执行，很多用户甚至都不会有机会执行他们。如果将这71%的脚本放在用户触发行为产生时才执行，将是对页面初期渲染性能多大的提升啊。</p>
<p>在ControlJs中，只需要简单做下面一步： </p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script cjsexec=false type=&quot;text/cjs&quot; cjssrc=&quot;jquery.min.js&quot;&gt;&lt;/script&gt;
</pre>
<p>声明一个cjsexec为false即可。到需要执行的时候，调用：</p>
<pre class="brush: jscript; title: ; notranslate">
CJS.execScript(&quot;fg.menu.js&quot;, createExamplesMenu);
</pre>
<p>即可。</p>
<p><strong>3. 重写document.write</strong></p>
<p>由于ControlJs会将所有脚本在window.onload之后执行。如果此时页面中有内联脚本执行document.write（广告等），将会自动执行window.open，所有的document.write的内容将取代现有页面的内容，这是不可接受的。</p>
<p>于是Steve重写了document.write，当调用时，会在script节点前自动创建一个span 标签，并把document.write的输出放到span里面去。这个能解决部分问题。</p>
<p>这里有个简单的DEMO：<br />
1. 引入 ControlJS</p>
<pre class="brush: jscript; title: ; notranslate">
var cjsscript = document.createElement('script');
cjsscript.src = &quot;control.js&quot;;
var cjssib = document.getElementsByTagName('script')&#x5B;0];
cjssib.parentNode.insertBefore(cjsscript, cjssib);
</pre>
<p>2. 修改外部脚本</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot; src=&quot;main.js&quot;&gt;&lt;script&gt;
</pre>
<p>改为</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/cjs&quot; data-cjssrc=&quot;main.js&quot;&gt;&lt;script&gt;
</pre>
<p>3. 修改 inline 脚本</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
var name = getName();
&lt;script&gt;
</pre>
<p>改为 “text/cjs”, 如下所示：</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/cjs&quot;&gt;
var name = getName();
&lt;script&gt;
</pre>
<p><strong>#ControlJS 包括了下面一些其他脚本加载程序没有的特点：</strong></p>
<p>    异步下载脚本<br />
    能同时处理外链和内联脚本<br />
    让脚本在页面加载完成之后才执行<br />
    支持脚本单纯下载但不执行<br />
    使用原生HTML<br />
    解决了部分document.write的问题<br />
    control.js自身加载是异步的 </p>
<p><strong>其他相关参考文档：</strong><br />
http://www.stevesouders.com/blog/2010/12/15/controljs-part-1/<br />
http://www.stevesouders.com/blog/2010/12/15/controljs-part-2/<br />
http://www.stevesouders.com/blog/2010/12/15/controljs-part-3/<br />
http://googlecode.blogspot.com/2009/09/gmail-for-mobile-html5-series-reducing.html （需翻墙）</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.mudbest.com/controljs%e7%ae%80%e5%8d%95%e5%ba%94%e7%94%a8%e4%bb%8b%e7%bb%8d/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>js简单实现时间格式倒计时</title>
		<link>https://www.mudbest.com/js%e7%ae%80%e5%8d%95%e5%ae%9e%e7%8e%b0%e6%97%b6%e9%97%b4%e6%a0%bc%e5%bc%8f%e5%80%92%e8%ae%a1%e6%97%b6/</link>
		
		<dc:creator><![CDATA[hkshadow]]></dc:creator>
		<pubDate>Tue, 13 Mar 2012 03:48:23 +0000</pubDate>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[倒计时]]></category>
		<category><![CDATA[时间格式倒计时]]></category>
		<guid isPermaLink="false">http://www.mudbest.com/?p=913</guid>

					<description><![CDATA[在网上找了很多相关的例子，总觉得还是要根据需求来写不一样的代码，就如我只是想要实现一个时间格式的倒计时，就不需 ... <a title="js简单实现时间格式倒计时" class="read-more" href="https://www.mudbest.com/js%e7%ae%80%e5%8d%95%e5%ae%9e%e7%8e%b0%e6%97%b6%e9%97%b4%e6%a0%bc%e5%bc%8f%e5%80%92%e8%ae%a1%e6%97%b6/" aria-label="阅读 js简单实现时间格式倒计时">阅读更多</a>]]></description>
										<content:encoded><![CDATA[<p>在网上找了很多相关的例子，总觉得还是要根据需求来写不一样的代码，就如我只是想要实现一个时间格式的倒计时，就不需要什么插件了，简短的一段代码即可实现。</p>
<p>看代码了：<br />
<span id="more-913"></span></p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;
&lt;!--
var maxtime = 7200;//按秒计算，自己调整! by hkshadow QQ 2765237
function CountDown(){
 if(maxtime &gt;= 0){
 seconds = maxtime--;
 	//var d = parseInt(seconds/86400);
 	var h = parseInt((seconds%86400)/3600);
	var m = parseInt((seconds%3600)/60);
	var s = parseInt(seconds%60);
	
	var h = h &gt; 0 ? h : &quot;00&quot;;
	var m = m &gt; 0 ? m : &quot;00&quot;;
	var s = s &gt; 0 ? s : &quot;00&quot;;
	
 	//msg = d+&quot;天&quot;+h+&quot;小时&quot;+m+&quot;分钟&quot;+s+&quot;秒&quot;;  //倒计时
  	//msg = &quot;&quot;+h+&quot;：&quot;+m+&quot;：&quot;+s+&quot;：&quot;;  //倒计时
	//var date_array = &#x5B;h,m,s];
 	document.getElementById('hour').innerHTML=h;
 	document.getElementById('minute').innerHTML=m;
  	document.getElementById('second').innerHTML=s;
}
 else{
		clearInterval(second);
		//P.cancel();
	// top.location = &quot;/index.php&quot;;
	 }
}
setInterval(&quot;CountDown()&quot;,1000);
//--&gt;
&lt;/script&gt;
</pre>
<p>html页面代码：</p>
<pre class="brush: xml; title: ; notranslate">
&lt;span class=&quot;thespan1&quot; id=&quot;hour&quot;&gt;..&lt;/span&gt;
&lt;span class=&quot;thespan2&quot;&gt;：&lt;/span&gt;
&lt;span class=&quot;thespan1&quot; id=&quot;minute&quot;&gt;..&lt;/span&gt;
&lt;span class=&quot;thespan2&quot;&gt;：&lt;/span&gt;
&lt;span class=&quot;thespan1&quot; id=&quot;second&quot;&gt;..&lt;/span&gt;
</pre>
<p>最后的效果是<br />
1：24：50</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>js取内容的某段</title>
		<link>https://www.mudbest.com/js%e5%8f%96%e5%86%85%e5%ae%b9%e7%9a%84%e6%9f%90%e6%ae%b5/</link>
		
		<dc:creator><![CDATA[hkshadow]]></dc:creator>
		<pubDate>Thu, 29 Sep 2011 07:32:37 +0000</pubDate>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[取值]]></category>
		<category><![CDATA[正则]]></category>
		<guid isPermaLink="false">http://www.mudbest.com/?p=812</guid>

					<description><![CDATA[例如取下列代码之中的content &#60;div attribute='123'&#62;content&#038;lt ... <a title="js取内容的某段" class="read-more" href="https://www.mudbest.com/js%e5%8f%96%e5%86%85%e5%ae%b9%e7%9a%84%e6%9f%90%e6%ae%b5/" aria-label="阅读 js取内容的某段">阅读更多</a>]]></description>
										<content:encoded><![CDATA[<p>例如取下列代码之中的content</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div attribute='123'&gt;content&lt;/div&gt;
</pre>
<p>以下JS可取的<br />
<span id="more-812"></span></p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot; &gt;
var reg = new RegExp(/&lt;div.*?&gt;(.*?)&lt;\/div&gt;/);
if(reg.test(&quot;&lt;div attribute='123'&gt;content&lt;/div&gt;&quot;))
{
        alert(RegExp.$1);
} 
&lt;/script&gt;
</pre>
<p>一小部分正则例子</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot; &gt;
	var b = &quot;abcdefg&quot;;
	var arr;
	var patrn=/^(.*)$/;  
	if (arr = patrn.exec(b) != null){
		//真
	//	alert (arr);
	}else{
		//假
	//	alert (arr);
	}
&lt;/script&gt;
</pre>
<p>以上均为小例子~~给初学者一个范例。</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Javascript全选反选函数</title>
		<link>https://www.mudbest.com/javascript%e5%85%a8%e9%80%89%e5%8f%8d%e9%80%89%e5%87%bd%e6%95%b0/</link>
		
		<dc:creator><![CDATA[hkshadow]]></dc:creator>
		<pubDate>Thu, 28 Apr 2011 09:45:13 +0000</pubDate>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[全选反选]]></category>
		<guid isPermaLink="false">http://www.mudbest.com/?p=616</guid>

					<description><![CDATA[Js函数部分.. //2011-04-28 //by hkshadow function CheckAll(s ... <a title="Javascript全选反选函数" class="read-more" href="https://www.mudbest.com/javascript%e5%85%a8%e9%80%89%e5%8f%8d%e9%80%89%e5%87%bd%e6%95%b0/" aria-label="阅读 Javascript全选反选函数">阅读更多</a>]]></description>
										<content:encoded><![CDATA[<p>Js函数部分..</p>
<pre class="brush: jscript; title: ; notranslate">
//2011-04-28
//by hkshadow
function CheckAll(s,b){
	var a = document.getElementById(s).getElementsByTagName(&quot;input&quot;);
	var selall=document.getElementById(b).checked;
	for (var i=0; i&lt;a.length; i++)
	   if(selall==true){
       		for (var i=0; i&lt;a.length; i++)
	   				if (a&#x5B;i].type == &quot;checkbox&quot;) a&#x5B;i].checked = true;
			 }else{ 		
  				for (var i=0; i&lt;a.length; i++)	
       			if (a&#x5B;i].type == &quot;checkbox&quot;) a&#x5B;i].checked = false ;
			}
	}
</pre>
<p>HTML演示部分..<span id="more-616"></span></p>
<pre class="brush: xml; title: ; notranslate">
                            &lt;ul class=&quot;mix2&quot;&gt;
               &lt;li class=&quot;mix1&quot;&gt;解析几何与高等代数&lt;/li&gt;
               &lt;li class=&quot;mix2&quot;  id=&quot;fk1&quot;&gt;
              
                              &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;1996&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202157&quot;&gt;
               &lt;/em&gt;
			               &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;1997&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202158&quot;&gt;
               &lt;/em&gt;
			               &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;1998&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202159&quot;&gt;
               &lt;/em&gt;
			               &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;1999&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202160&quot;&gt;
               &lt;/em&gt;
			               &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;2000&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202161&quot;&gt;
               &lt;/em&gt;
			               &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;2001&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202162&quot;&gt;
               &lt;/em&gt;
			               &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;2002&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202163&quot;&gt;
               &lt;/em&gt;
			               &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;2005&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202164&quot;&gt;
               &lt;/em&gt;
			               &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;2007&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202165&quot;&gt;
               &lt;/em&gt;
			               &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;2007答案&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202166&quot;&gt;
               &lt;/em&gt;
			               &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;2008&#x5B;5元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202167&quot;&gt;
               &lt;/em&gt;
			               
               &lt;em&gt;&lt;span&gt;全选&lt;/span&gt;&amp;nbsp;&lt;input type=&quot;checkbox&quot; name=&quot;all&quot; id=&quot;ok1&quot; onclick=&quot;CheckAll('fk1','ok1')&quot; class=&quot;text&quot;&gt;&lt;/em&gt;
               
               &lt;/li&gt;
              &lt;/ul&gt;
                         &lt;ul class=&quot;mix2&quot;&gt;
               &lt;li class=&quot;mix1&quot;&gt;数学分析&lt;/li&gt;
               &lt;li class=&quot;mix2&quot;  id=&quot;fk2&quot;&gt;
              
                              &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;1996&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202149&quot;&gt;
               &lt;/em&gt;
			               &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;1997&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202150&quot;&gt;
               &lt;/em&gt;
			               &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;1998&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202151&quot;&gt;
               &lt;/em&gt;
			               &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;1999&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202152&quot;&gt;
               &lt;/em&gt;
			               &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;2000&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202153&quot;&gt;
               &lt;/em&gt;
			               &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;2001&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202154&quot;&gt;
               &lt;/em&gt;
			               &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;2002&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202155&quot;&gt;
               &lt;/em&gt;
			               &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;2008&#x5B;5元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202156&quot;&gt;
               &lt;/em&gt;
			               
               &lt;em&gt;&lt;span&gt;全选&lt;/span&gt;&amp;nbsp;&lt;input type=&quot;checkbox&quot; name=&quot;all&quot; id=&quot;ok2&quot; onclick=&quot;CheckAll('fk2','ok2')&quot; class=&quot;text&quot;&gt;&lt;/em&gt;
               
               &lt;/li&gt;
              &lt;/ul&gt;
                         &lt;ul class=&quot;mix2&quot;&gt;
               &lt;li class=&quot;mix1&quot;&gt;数学学院专业综合考试&lt;/li&gt;
               &lt;li class=&quot;mix2&quot;  id=&quot;fk3&quot;&gt;
              
                              &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;1996&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202168&quot;&gt;
               &lt;/em&gt;
			               &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;1997&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202169&quot;&gt;
               &lt;/em&gt;
			               &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;1998&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202170&quot;&gt;
               &lt;/em&gt;
			               &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;1999&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202171&quot;&gt;
               &lt;/em&gt;
			               &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;2000&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202172&quot;&gt;
               &lt;/em&gt;
			               &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;2001&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202173&quot;&gt;
               &lt;/em&gt;
			               &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;2002&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202174&quot;&gt;
               &lt;/em&gt;
			               &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;2004&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202175&quot;&gt;
               &lt;/em&gt;
			               &lt;em&gt;
               &lt;a href=&quot;#none&quot; onClick=&quot;alert('缺少页面，未作');&quot;&gt;2005&#x5B;3元]&lt;/a&gt;&amp;nbsp;
               &lt;input type=&quot;checkbox&quot; name=&quot;checks&#x5B;]&quot; class=&quot;text&quot; value=&quot;202176&quot;&gt;
               &lt;/em&gt;
			               
               &lt;em&gt;&lt;span&gt;全选&lt;/span&gt;&amp;nbsp;&lt;input type=&quot;checkbox&quot; name=&quot;all&quot; id=&quot;ok3&quot; onclick=&quot;CheckAll('fk3','ok3')&quot; class=&quot;text&quot;&gt;&lt;/em&gt;
               
               &lt;/li&gt;
              &lt;/ul&gt;
</pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Javascript鼠标事件</title>
		<link>https://www.mudbest.com/javascript%e9%bc%a0%e6%a0%87%e4%ba%8b%e4%bb%b6/</link>
		
		<dc:creator><![CDATA[hkshadow]]></dc:creator>
		<pubDate>Wed, 13 Apr 2011 08:58:33 +0000</pubDate>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[onmouse]]></category>
		<guid isPermaLink="false">http://www.mudbest.com/?p=587</guid>

					<description><![CDATA[&#60;script type=&#34;text/javascript&#34;&#62; functio ... <a title="Javascript鼠标事件" class="read-more" href="https://www.mudbest.com/javascript%e9%bc%a0%e6%a0%87%e4%ba%8b%e4%bb%b6/" aria-label="阅读 Javascript鼠标事件">阅读更多</a>]]></description>
										<content:encoded><![CDATA[<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
function onmouseup_a(){
alert('当鼠标按钮被松开时执行脚本');
}

function onmousemove_a(){
alert('当鼠标指针移动时执行脚本');
}

function onmousedown_a(){
alert('当鼠标按钮被按下时执行脚本');
}
function onmouseout_a(){
alert('当鼠标指针移出某元素时执行脚本');
}

function onmouseover_a(){
alert('当鼠标指针悬停于某元素之上时执行脚本');
}

function onclick_a(){
alert('当鼠标被单击时执行脚本');
}

function ondblclick_a(){
alert('当鼠标被双击时执行脚本');
}
&lt;/script&gt; 
</pre>
<p>例子如下：<span id="more-587"></span></p>
<pre class="brush: xml; title: ; notranslate">
&lt;ul&gt;
&lt;li onmouseup=&quot;onmouseup_a()&quot; style=&quot;color:green&quot;&gt;当鼠标按钮被松开时执行脚本&lt;/li&gt;
&lt;li onmousemove=&quot;onmousemove_a()&quot; style=&quot;color:red&quot;&gt;当鼠标指针移动时执行脚本&lt;/li&gt;
&lt;li onmousedown=&quot;onmousedown_a()&quot; style=&quot;color:blue&quot;&gt;当鼠标按钮被按下时执行脚本&lt;/li&gt;
&lt;li onmouseout=&quot;onmouseout_a()&quot; style=&quot;color:#666666&quot;&gt;当鼠标指针移出某元素时执行脚本&lt;/li&gt;
&lt;li onmouseover=&quot;onmouseover_a()&quot; style=&quot;color:#DEDBD6&quot;&gt;当鼠标指针悬停于某元素之上时执行脚本&lt;/li&gt;
&lt;li onclick=&quot;onclick_a()&quot; style=&quot;color:#222222&quot;&gt;当鼠标被单击时执行脚本&lt;/li&gt;
&lt;li ondblclick=&quot;ondblclick_a()&quot; style=&quot;color:#111111&quot;&gt;当鼠标被双击时执行脚本&lt;/li&gt;
&lt;/ul&gt;
</pre>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
