<?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>Jennal's Blog &#187; Javascript</title>
	<atom:link href="http://jennal.cn/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://jennal.cn</link>
	<description>Jennal的技术博客</description>
	<lastBuildDate>Tue, 06 Mar 2012 00:51:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>[转]javascript中判断变量是否为array</title>
		<link>http://jennal.cn/2010/02/23/javascript%e4%b8%ad%e5%88%a4%e6%96%ad%e5%8f%98%e9%87%8f%e6%98%af%e5%90%a6%e4%b8%baarray/</link>
		<comments>http://jennal.cn/2010/02/23/javascript%e4%b8%ad%e5%88%a4%e6%96%ad%e5%8f%98%e9%87%8f%e6%98%af%e5%90%a6%e4%b8%baarray/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 08:59:58 +0000</pubDate>
		<dc:creator>Jennal</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web前台相关]]></category>

		<guid isPermaLink="false">http://jennal.cn/?p=399</guid>
		<description><![CDATA[javascript中要判断一个变量是否为array通常是比较困难的，因为

 var a = &#91;&#93;;
 alert&#40;typeof a === 'object'&#41;; // true

通常的做法是判断

 a.constructor === Array  // true

可是这个方法有一个问题，如果一个数组是来自另一个frame中的，那么它的constructor 将是另一个对象。
YUI中用了如下的方法：

    isArray: function&#40;o&#41; &#123;
        if &#40;o&#41; &#123;
           return L.isNumber&#40;o.length&#41; &#38;&#38; L.isFunction&#40;o.splice&#41;;
        [...]<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F04%2F24%2Fjavascript-timeout-hacks%2F&from=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2Fjavascript%25E4%25B8%25AD%25E5%2588%25A4%25E6%2596%25AD%25E5%258F%2598%25E9%2587%258F%25E6%2598%25AF%25E5%2590%25A6%25E4%25B8%25BAarray%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript Timeout Hacks</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2008%2F10%2F06%2Fjavascript%25E4%25B8%25AD%25E8%258E%25B7%25E5%258F%2596%25E5%2585%2583%25E7%25B4%25A0%25E7%259A%2584%25E7%25BB%259D%25E5%25AF%25B9%25E4%25BD%258D%25E7%25BD%25AE%2F&from=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2Fjavascript%25E4%25B8%25AD%25E5%2588%25A4%25E6%2596%25AD%25E5%258F%2598%25E9%2587%258F%25E6%2598%25AF%25E5%2590%25A6%25E4%25B8%25BAarray%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">JavaScript中获取元素的绝对位置</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Fjlutil-for-javascript%2F&from=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2Fjavascript%25E4%25B8%25AD%25E5%2588%25A4%25E6%2596%25AD%25E5%258F%2598%25E9%2587%258F%25E6%2598%25AF%25E5%2590%25A6%25E4%25B8%25BAarray%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">jlUtil For Javascript</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F18%2Fpro-javascript-techniques-menu%2F&from=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2Fjavascript%25E4%25B8%25AD%25E5%2588%25A4%25E6%2596%25AD%25E5%258F%2598%25E9%2587%258F%25E6%2598%25AF%25E5%2590%25A6%25E4%25B8%25BAarray%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Pro Javascript Techniques – 目录</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>javascript中要判断一个变量是否为array通常是比较困难的，因为</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"> <span style="color: #003366; font-weight: bold;">var</span> a <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
 <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> a <span style="color: #339933;">===</span> <span style="color: #3366CC;">'object'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// true</span></pre></div></div>

<p>通常的做法是判断</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"> a.<span style="color: #660066;">constructor</span> <span style="color: #339933;">===</span> Array  <span style="color: #006600; font-style: italic;">// true</span></pre></div></div>

<p>可是这个方法有一个问题，如果一个数组是来自另一个frame中的，那么它的constructor 将是另一个对象。</p>
<p>YUI中用了如下的方法：</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">    isArray<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>o<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>o<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
           <span style="color: #000066; font-weight: bold;">return</span> L.<span style="color: #660066;">isNumber</span><span style="color: #009900;">&#40;</span>o.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> L.<span style="color: #660066;">isFunction</span><span style="color: #009900;">&#40;</span>o.<span style="color: #660066;">splice</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span></pre></div></div>

<p>简单来说，就是判断这个变量有没有 length 属性，同时有没有 splice 方法。可惜，这样的判断方法是可以用一个 object 来伪造数组的。</p>
<p>Google 的 Mark Miller 发现，用下面方法，可以简单又可靠的得到一个变量是否一个数组：</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Object.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">toString</span>.<span style="color: #660066;">apply</span><span style="color: #009900;">&#40;</span>value<span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #3366CC;">'[object Array]'</span></pre></div></div>

<p>转自：<a href="http://stauren.net/log/fqibpxyz3.html">http://stauren.net/log/fqibpxyz3.html</a></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F04%2F24%2Fjavascript-timeout-hacks%2F&from=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2Fjavascript%25E4%25B8%25AD%25E5%2588%25A4%25E6%2596%25AD%25E5%258F%2598%25E9%2587%258F%25E6%2598%25AF%25E5%2590%25A6%25E4%25B8%25BAarray%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript Timeout Hacks</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2008%2F10%2F06%2Fjavascript%25E4%25B8%25AD%25E8%258E%25B7%25E5%258F%2596%25E5%2585%2583%25E7%25B4%25A0%25E7%259A%2584%25E7%25BB%259D%25E5%25AF%25B9%25E4%25BD%258D%25E7%25BD%25AE%2F&from=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2Fjavascript%25E4%25B8%25AD%25E5%2588%25A4%25E6%2596%25AD%25E5%258F%2598%25E9%2587%258F%25E6%2598%25AF%25E5%2590%25A6%25E4%25B8%25BAarray%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">JavaScript中获取元素的绝对位置</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Fjlutil-for-javascript%2F&from=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2Fjavascript%25E4%25B8%25AD%25E5%2588%25A4%25E6%2596%25AD%25E5%258F%2598%25E9%2587%258F%25E6%2598%25AF%25E5%2590%25A6%25E4%25B8%25BAarray%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">jlUtil For Javascript</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F18%2Fpro-javascript-techniques-menu%2F&from=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2Fjavascript%25E4%25B8%25AD%25E5%2588%25A4%25E6%2596%25AD%25E5%258F%2598%25E9%2587%258F%25E6%2598%25AF%25E5%2590%25A6%25E4%25B8%25BAarray%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Pro Javascript Techniques – 目录</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://jennal.cn/2010/02/23/javascript%e4%b8%ad%e5%88%a4%e6%96%ad%e5%8f%98%e9%87%8f%e6%98%af%e5%90%a6%e4%b8%baarray/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>更新一下我的jlUtil</title>
		<link>http://jennal.cn/2010/02/23/%e6%9b%b4%e6%96%b0%e4%b8%80%e4%b8%8b%e6%88%91%e7%9a%84jlutil/</link>
		<comments>http://jennal.cn/2010/02/23/%e6%9b%b4%e6%96%b0%e4%b8%80%e4%b8%8b%e6%88%91%e7%9a%84jlutil/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 08:50:32 +0000</pubDate>
		<dc:creator>Jennal</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web前台相关]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[json_encode]]></category>

		<guid isPermaLink="false">http://jennal.cn/?p=394</guid>
		<description><![CDATA[修正了几个BUG，已经在实际项目中使用，没有问题。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Array.prototype.indexOf &#124;&#124; &#40;Array.prototype.indexOf = function&#40;value&#41; &#123;
      for &#40;var i in this&#41; &#123;
          if &#40;this&#91;i&#93; == value&#41; &#123;
              return i;
          [...]<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Fjlutil-for-javascript%2F&from=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2F%25E6%259B%25B4%25E6%2596%25B0%25E4%25B8%2580%25E4%25B8%258B%25E6%2588%2591%25E7%259A%2584jlutil%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">jlUtil For Javascript</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2008%2F12%2F07%2F%25E6%2590%259E%25E5%25AE%259A%25E4%25B8%2580%25E4%25B8%25AA%25E5%25BE%2588%25E7%25BA%25A0%25E7%25BB%2593%25E7%259A%2584json%25E9%2597%25AE%25E9%25A2%2598%25EF%25BC%258C%25E8%25AE%25B0%25E5%25BD%2595%25E4%25B8%2580%25E4%25B8%258B%2F&from=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2F%25E6%259B%25B4%25E6%2596%25B0%25E4%25B8%2580%25E4%25B8%258B%25E6%2588%2591%25E7%259A%2584jlutil%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">搞定一个很纠结的json问题，记录一下</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F04%2F24%2Fjavascript-timeout-hacks%2F&from=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2F%25E6%259B%25B4%25E6%2596%25B0%25E4%25B8%2580%25E4%25B8%258B%25E6%2588%2591%25E7%259A%2584jlutil%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript Timeout Hacks</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F18%2Fpro-javascript-techniques-menu%2F&from=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2F%25E6%259B%25B4%25E6%2596%25B0%25E4%25B8%2580%25E4%25B8%258B%25E6%2588%2591%25E7%259A%2584jlutil%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Pro Javascript Techniques – 目录</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>修正了几个BUG，已经在实际项目中使用，没有问题。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">Array.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">indexOf</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>Array.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">indexOf</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>value<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #000066; font-weight: bold;">in</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> value<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
              <span style="color: #000066; font-weight: bold;">return</span> i<span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
Array.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">remove</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>b<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> a <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span>b<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>a <span style="color: #339933;">&gt;=</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">splice</span><span style="color: #009900;">&#40;</span>a<span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
window.<span style="color: #660066;">jlUtil</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
    getJSON<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>obj<span style="color: #339933;">,</span> skip_arr<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> obj <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;number&quot;</span>
        <span style="color: #339933;">||</span> <span style="color: #000066; font-weight: bold;">typeof</span> obj <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;boolean&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">return</span> obj<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> obj <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;string&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">&quot;'&quot;</span> <span style="color: #339933;">+</span> obj.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;'&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>'&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;'&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>obj<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">&quot;''&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #003366; font-weight: bold;">var</span> json <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        skip_arr <span style="color: #339933;">=</span> skip_arr <span style="color: #339933;">?</span> skip_arr <span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> key <span style="color: #000066; font-weight: bold;">in</span> obj<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #006600; font-style: italic;">//skip function and the keys in skip arr</span>
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> obj<span style="color: #009900;">&#91;</span>key<span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;function&quot;</span>
            <span style="color: #339933;">||</span> skip_arr.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span>key<span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000066; font-weight: bold;">continue</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #006600; font-style: italic;">//in Array loop</span>
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>isNaN<span style="color: #009900;">&#40;</span>key<span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> key.<span style="color: #660066;">constructor</span> <span style="color: #339933;">!=</span> String<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                json.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>jlUtil.<span style="color: #660066;">getJSON</span><span style="color: #009900;">&#40;</span>obj<span style="color: #009900;">&#91;</span>key<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> skip_arr<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000066; font-weight: bold;">continue</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #006600; font-style: italic;">//else recurrency</span>
            json.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;'&quot;</span> <span style="color: #339933;">+</span> key <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;':&quot;</span> <span style="color: #339933;">+</span> jlUtil.<span style="color: #660066;">getJSON</span><span style="color: #009900;">&#40;</span>obj<span style="color: #009900;">&#91;</span>key<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> skip_arr<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>Object.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">toString</span>.<span style="color: #660066;">apply</span><span style="color: #009900;">&#40;</span>obj<span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #3366CC;">'[object Array]'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">&quot;[&quot;</span> <span style="color: #339933;">+</span> json.<span style="color: #660066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;,&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;]&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">&quot;{&quot;</span> <span style="color: #339933;">+</span> json.<span style="color: #660066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;,&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;}&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    extend<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>obj<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>arguments.<span style="color: #660066;">length</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span> obj<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>arguments.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;=</span> <span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> dst <span style="color: #339933;">=</span> arguments<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
            <span style="color: #006600; font-style: italic;">//extend the rest args to args[0]</span>
            <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> arguments.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> <span style="color: #339933;">++</span>i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> <span style="color: #000066; font-weight: bold;">item</span> <span style="color: #000066; font-weight: bold;">in</span> arguments<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #003366; font-weight: bold;">var</span> tmp <span style="color: #339933;">=</span> arguments<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> arguments<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;object&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #006600; font-style: italic;">//make a copy while is a object, needs jQuery here</span>
                        <span style="color: #003366; font-weight: bold;">var</span> tmp <span style="color: #339933;">=</span> $.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> arguments<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span>
                    <span style="color: #006600; font-style: italic;">//if is object try recurrency</span>
                    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>dst<span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000066; font-weight: bold;">typeof</span> dst<span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;object&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #000066; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
                            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>dst<span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> tmp<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                            dst<span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> tmp<span style="color: #339933;">;</span>
                        <span style="color: #009900;">&#125;</span>
                    <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
                        dst<span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> tmp<span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000066; font-weight: bold;">return</span> dst<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Fjlutil-for-javascript%2F&from=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2F%25E6%259B%25B4%25E6%2596%25B0%25E4%25B8%2580%25E4%25B8%258B%25E6%2588%2591%25E7%259A%2584jlutil%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">jlUtil For Javascript</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2008%2F12%2F07%2F%25E6%2590%259E%25E5%25AE%259A%25E4%25B8%2580%25E4%25B8%25AA%25E5%25BE%2588%25E7%25BA%25A0%25E7%25BB%2593%25E7%259A%2584json%25E9%2597%25AE%25E9%25A2%2598%25EF%25BC%258C%25E8%25AE%25B0%25E5%25BD%2595%25E4%25B8%2580%25E4%25B8%258B%2F&from=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2F%25E6%259B%25B4%25E6%2596%25B0%25E4%25B8%2580%25E4%25B8%258B%25E6%2588%2591%25E7%259A%2584jlutil%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">搞定一个很纠结的json问题，记录一下</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F04%2F24%2Fjavascript-timeout-hacks%2F&from=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2F%25E6%259B%25B4%25E6%2596%25B0%25E4%25B8%2580%25E4%25B8%258B%25E6%2588%2591%25E7%259A%2584jlutil%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript Timeout Hacks</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F18%2Fpro-javascript-techniques-menu%2F&from=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2F%25E6%259B%25B4%25E6%2596%25B0%25E4%25B8%2580%25E4%25B8%258B%25E6%2588%2591%25E7%259A%2584jlutil%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Pro Javascript Techniques – 目录</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://jennal.cn/2010/02/23/%e6%9b%b4%e6%96%b0%e4%b8%80%e4%b8%8b%e6%88%91%e7%9a%84jlutil/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Array.indexOf in Internet Explorer</title>
		<link>http://jennal.cn/2009/07/31/array-indexof-in-internet-explorer/</link>
		<comments>http://jennal.cn/2009/07/31/array-indexof-in-internet-explorer/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 13:39:29 +0000</pubDate>
		<dc:creator>Jennal</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web前台相关]]></category>
		<category><![CDATA[英语]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[IE6]]></category>

		<guid isPermaLink="false">http://jennal.cn/?p=196</guid>
		<description><![CDATA[
According to this document at Mozilla Developer Center, Javascript 1.5 has been implemented in a browser since at least the first releases of Mozilla as open source browser, which means, in other words, since around 1998. Let&#8217;s assume it was 2002 which is marked as the release of the 1.0 version.
And I was doing some [...]<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F04%2F24%2Fjavascript-timeout-hacks%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Farray-indexof-in-internet-explorer%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript Timeout Hacks</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2Fjavascript%25E4%25B8%25AD%25E5%2588%25A4%25E6%2596%25AD%25E5%258F%2598%25E9%2587%258F%25E6%2598%25AF%25E5%2590%25A6%25E4%25B8%25BAarray%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Farray-indexof-in-internet-explorer%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[转]javascript中判断变量是否为array</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F01%2F18%2Fjavascript-%25E5%2588%25B7%25E6%2596%25B0%25E9%25A1%25B5%25E9%259D%25A2%25E7%259A%2584%25E5%2587%25A0%25E7%25A7%258D%25E6%2596%25B9%25E6%25B3%2595%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Farray-indexof-in-internet-explorer%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript 刷新页面的几种方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F12%2F16%2Finput-submit-button-doesnt-display-background-image-in-ie%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Farray-indexof-in-internet-explorer%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Input submit button doesn’t display background image in IE</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<div>
<p>According to <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:About#JavaScript_versions">this document</a> at Mozilla Developer Center, Javascript 1.5 has been implemented in a browser since at least the first releases of Mozilla as open source browser, which means, in other words, <strong>since around 1998</strong>. Let&#8217;s assume <strong>it was 2002</strong> which is marked as the release of the 1.0 version.</p>
<p>And I was doing some interface programming lately and I needed to <strong>check if an element was in an array</strong>. Went to Gecko&#8217;s documentation (that&#8217;s the one I normally use, since it&#8217;s less overbloated with crappy ads) and checked that Array objects had an indexOf function. Cool! I used that function on my code. Then once I finished with all the development, went to <em>The Horror</em> (i.e. Internet Explorer) and tested it.</p>
<p>Surprise! <strong>It was broken!</strong> What had I done? (You know the debugger for Internet Explorer is not <em>specially helpful</em>)</p>
<p>I suspected of the indexOf function, and recalled vague memories about doing a custom search function in the past for looking into arrays and not having to write a for(i=0; i&lt;ar.length;i++) thing each time…</p>
<p>Mmmm… did a alert(&#8216;Array.indexO&#8217;) in ie and what did I get?: <em>undefined</em></p>
<p>So they have been spent five years for releasing ie7 and still they didn&#8217;t implement Array.indexOf!</p>
<p>No worries, though. <strong>Javascript is flexible!</strong> Look, IE, I don&#8217;t care if you choke on the mere seeing of indexOf, you&#8217;re going to run it whether you like it or not!</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>Array.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    Array.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">indexOf</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>obj<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>this.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">==</span>obj<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #000066; font-weight: bold;">return</span> i<span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>and voila! my script wasn&#8217;t broken anymore!</p></div>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F04%2F24%2Fjavascript-timeout-hacks%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Farray-indexof-in-internet-explorer%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript Timeout Hacks</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2Fjavascript%25E4%25B8%25AD%25E5%2588%25A4%25E6%2596%25AD%25E5%258F%2598%25E9%2587%258F%25E6%2598%25AF%25E5%2590%25A6%25E4%25B8%25BAarray%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Farray-indexof-in-internet-explorer%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[转]javascript中判断变量是否为array</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F01%2F18%2Fjavascript-%25E5%2588%25B7%25E6%2596%25B0%25E9%25A1%25B5%25E9%259D%25A2%25E7%259A%2584%25E5%2587%25A0%25E7%25A7%258D%25E6%2596%25B9%25E6%25B3%2595%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Farray-indexof-in-internet-explorer%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript 刷新页面的几种方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F12%2F16%2Finput-submit-button-doesnt-display-background-image-in-ie%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Farray-indexof-in-internet-explorer%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Input submit button doesn’t display background image in IE</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://jennal.cn/2009/07/31/array-indexof-in-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jlUtil For Javascript</title>
		<link>http://jennal.cn/2009/07/31/jlutil-for-javascript/</link>
		<comments>http://jennal.cn/2009/07/31/jlutil-for-javascript/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 01:35:25 +0000</pubDate>
		<dc:creator>Jennal</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web前台相关]]></category>
		<category><![CDATA[extend]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[json_encode]]></category>

		<guid isPermaLink="false">http://jennal.cn/?p=190</guid>
		<description><![CDATA[昨天用js写了一个Json_encode的工具函数，附上模仿jQuery并加强的extend函数。
对于extend函数，主要加强的是可以遍历子对象来extend，而不是简单的覆盖。
getJSON的使用方法：

jlUtil.getJSON&#40;obj:Object &#91;, skip_arr:Array&#93;&#41;
//skip_arr指定要忽略的键名

extend的使用方法：

jlUtil.extend&#40;obj:Object &#91;, obj2:Object...&#93;&#41;
//这个函数需要jQuery
//如果只带一个参数，则这个obj将被extend到jlUtil本身
//如果带两个以上的参数，则第2个及以后的参数将被extend到第一个参数

下面是代码：

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
var jlUtil = &#123;
	getJSON: function&#40;obj, skip_arr&#41;&#123;
		if&#40;typeof obj == &#34;number&#34;
		&#124;&#124; typeof obj == &#34;boolean&#34;&#41;&#123;
			return obj;
		&#125;else if&#40;typeof obj == &#34;string&#34;&#41;&#123;
			return &#34;'&#34; + obj.replace&#40;&#34;'&#34;,&#34;\\'&#34;&#41; + &#34;'&#34;;
		&#125;
&#160;
		var json = &#91;&#93;;
		skip_arr = skip_arr ? skip_arr : &#91;&#93;;
		for&#40;var key in obj&#41;&#123;
			//skip function and the keys in skip arr
			if&#40;obj&#91;key&#93;.constructor == Function
			&#124;&#124; skip_arr.indexOf&#40;key&#41; != -1&#41;&#123;
				continue;
			&#125;
&#160;
			//in Array loop
			if&#40;!isNaN&#40;parseInt&#40;key&#41;&#41; &#124;&#124; key.constructor [...]<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2F%25E6%259B%25B4%25E6%2596%25B0%25E4%25B8%2580%25E4%25B8%258B%25E6%2588%2591%25E7%259A%2584jlutil%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Fjlutil-for-javascript%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">更新一下我的jlUtil</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2008%2F12%2F07%2F%25E6%2590%259E%25E5%25AE%259A%25E4%25B8%2580%25E4%25B8%25AA%25E5%25BE%2588%25E7%25BA%25A0%25E7%25BB%2593%25E7%259A%2584json%25E9%2597%25AE%25E9%25A2%2598%25EF%25BC%258C%25E8%25AE%25B0%25E5%25BD%2595%25E4%25B8%2580%25E4%25B8%258B%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Fjlutil-for-javascript%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">搞定一个很纠结的json问题，记录一下</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F04%2F24%2Fjavascript-timeout-hacks%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Fjlutil-for-javascript%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript Timeout Hacks</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F01%2F18%2Fjavascript-%25E5%2588%25B7%25E6%2596%25B0%25E9%25A1%25B5%25E9%259D%25A2%25E7%259A%2584%25E5%2587%25A0%25E7%25A7%258D%25E6%2596%25B9%25E6%25B3%2595%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Fjlutil-for-javascript%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript 刷新页面的几种方法</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>昨天用js写了一个Json_encode的工具函数，附上模仿jQuery并加强的extend函数。<br />
对于extend函数，主要加强的是可以遍历子对象来extend，而不是简单的覆盖。</p>
<p>getJSON的使用方法：</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jlUtil.<span style="color: #660066;">getJSON</span><span style="color: #009900;">&#40;</span>obj<span style="color: #339933;">:</span>Object <span style="color: #009900;">&#91;</span><span style="color: #339933;">,</span> skip_arr<span style="color: #339933;">:</span>Array<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
<span style="color: #006600; font-style: italic;">//skip_arr指定要忽略的键名</span></pre></div></div>

<p>extend的使用方法：</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jlUtil.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>obj<span style="color: #339933;">:</span>Object <span style="color: #009900;">&#91;</span><span style="color: #339933;">,</span> obj2<span style="color: #339933;">:</span>Object...<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
<span style="color: #006600; font-style: italic;">//这个函数需要jQuery</span>
<span style="color: #006600; font-style: italic;">//如果只带一个参数，则这个obj将被extend到jlUtil本身</span>
<span style="color: #006600; font-style: italic;">//如果带两个以上的参数，则第2个及以后的参数将被extend到第一个参数</span></pre></div></div>

<p>下面是代码：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> jlUtil <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
	getJSON<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>obj<span style="color: #339933;">,</span> skip_arr<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> obj <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;number&quot;</span>
		<span style="color: #339933;">||</span> <span style="color: #000066; font-weight: bold;">typeof</span> obj <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;boolean&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">return</span> obj<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> obj <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;string&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">&quot;'&quot;</span> <span style="color: #339933;">+</span> obj.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;'&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>'&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;'&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #003366; font-weight: bold;">var</span> json <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		skip_arr <span style="color: #339933;">=</span> skip_arr <span style="color: #339933;">?</span> skip_arr <span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> key <span style="color: #000066; font-weight: bold;">in</span> obj<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #006600; font-style: italic;">//skip function and the keys in skip arr</span>
			<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>obj<span style="color: #009900;">&#91;</span>key<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">constructor</span> <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">Function</span>
			<span style="color: #339933;">||</span> skip_arr.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span>key<span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
				<span style="color: #000066; font-weight: bold;">continue</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
			<span style="color: #006600; font-style: italic;">//in Array loop</span>
			<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>isNaN<span style="color: #009900;">&#40;</span>parseInt<span style="color: #009900;">&#40;</span>key<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> key.<span style="color: #660066;">constructor</span> <span style="color: #339933;">!=</span> String<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
				json.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>jlUtil.<span style="color: #660066;">getJSON</span><span style="color: #009900;">&#40;</span>obj<span style="color: #009900;">&#91;</span>key<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> skip_arr<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000066; font-weight: bold;">continue</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
			<span style="color: #006600; font-style: italic;">//else recurrency</span>
			json.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;'&quot;</span> <span style="color: #339933;">+</span> key <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;':&quot;</span> <span style="color: #339933;">+</span> jlUtil.<span style="color: #660066;">getJSON</span><span style="color: #009900;">&#40;</span>obj<span style="color: #009900;">&#91;</span>key<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> skip_arr<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>obj.<span style="color: #660066;">constructor</span> <span style="color: #339933;">==</span> Array<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">&quot;[&quot;</span> <span style="color: #339933;">+</span> json.<span style="color: #660066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;,&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;]&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">&quot;{&quot;</span> <span style="color: #339933;">+</span> json.<span style="color: #660066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;,&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;}&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
	extend<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>obj<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>arguments.<span style="color: #660066;">length</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span> obj<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>arguments.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;=</span> <span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #003366; font-weight: bold;">var</span> dst <span style="color: #339933;">=</span> arguments<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #006600; font-style: italic;">//extend the rest args to args[0]</span>
			<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>arguments.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> <span style="color: #339933;">++</span>i<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
				<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> <span style="color: #000066; font-weight: bold;">item</span> <span style="color: #000066; font-weight: bold;">in</span> arguments<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
					<span style="color: #003366; font-weight: bold;">var</span> tmp <span style="color: #339933;">=</span> arguments<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
					<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> arguments<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;object&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
						<span style="color: #006600; font-style: italic;">//make a copy while is a object, needs jQuery here</span>
						<span style="color: #003366; font-weight: bold;">var</span> tmp <span style="color: #339933;">=</span> $.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> arguments<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
					<span style="color: #006600; font-style: italic;">//if is object try recurrency</span>
					<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>dst<span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000066; font-weight: bold;">typeof</span> dst<span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;object&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
						<span style="color: #000066; font-weight: bold;">try</span><span style="color: #009900;">&#123;</span>
							<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>dst<span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> tmp<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
							dst<span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> tmp<span style="color: #339933;">;</span>
						<span style="color: #009900;">&#125;</span>
					<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
						dst<span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> tmp<span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000066; font-weight: bold;">return</span> dst<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2F%25E6%259B%25B4%25E6%2596%25B0%25E4%25B8%2580%25E4%25B8%258B%25E6%2588%2591%25E7%259A%2584jlutil%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Fjlutil-for-javascript%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">更新一下我的jlUtil</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2008%2F12%2F07%2F%25E6%2590%259E%25E5%25AE%259A%25E4%25B8%2580%25E4%25B8%25AA%25E5%25BE%2588%25E7%25BA%25A0%25E7%25BB%2593%25E7%259A%2584json%25E9%2597%25AE%25E9%25A2%2598%25EF%25BC%258C%25E8%25AE%25B0%25E5%25BD%2595%25E4%25B8%2580%25E4%25B8%258B%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Fjlutil-for-javascript%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">搞定一个很纠结的json问题，记录一下</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F04%2F24%2Fjavascript-timeout-hacks%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Fjlutil-for-javascript%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript Timeout Hacks</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F01%2F18%2Fjavascript-%25E5%2588%25B7%25E6%2596%25B0%25E9%25A1%25B5%25E9%259D%25A2%25E7%259A%2584%25E5%2587%25A0%25E7%25A7%258D%25E6%2596%25B9%25E6%25B3%2595%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Fjlutil-for-javascript%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript 刷新页面的几种方法</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://jennal.cn/2009/07/31/jlutil-for-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[转]Web 设计与开发者必须知道的 15 个站点</title>
		<link>http://jennal.cn/2009/07/25/web-designer-developer-should-know-15-sites/</link>
		<comments>http://jennal.cn/2009/07/25/web-designer-developer-should-know-15-sites/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 16:12:50 +0000</pubDate>
		<dc:creator>Jennal</dc:creator>
				<category><![CDATA[Web前台相关]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://jennal.cn/?p=188</guid>
		<description><![CDATA[转一篇cb的好文，以后应该会用到。
公司博客整整一个月没有更新了，最近一段时间，全公司都忙于两件事，为海尔集团做定制，为一个合作伙伴做 OEM，终于有了眉目。工作期间，常用到一些工具与帮助站点，今天读到一篇文章，介绍了15个对 Web 设计与开发师极端有用的站点，里面有不少也是我们一直在使用的，也许对很多人都有用，翻译出来以饷同仁。 		ColorCombos

配色是 Web 设计的首要大事，Color Combos 帮你预备了数千种配色方案，可以根据色调浏览选取。
LIpsum

Lorem Ipsum Text 是一中自造的，字典中不存在的单词，是在演示页面结构的时候，需要加文字的地方使用 Lorem Ipsum Text 填充可以避免用户因关注文字的意思而分神。Lipsum.com 可以帮你生成制定数目的 Lorem Ipsum 单词。
What the font?

有时候你对某个 Logo 感兴趣，想知道是拿什么字体做的，可以将 Logo 图片上传到这个网站，结果之准确会让你难以置信。
ConvertIcon

Favicon 越来越受欢迎，尤其随着 Firefox 的流行，Firefox 会将你站点的 Favicon 标志显示在标签上，也会显示于书签，Favicon 支持多种图形格式，比如 png，但 IE 并不支持 png，该站点可以帮助你将 png 等图片格式的 Favicon 转换成 IE 支持的 ico 格式。
BgPatterns

现代 Web 设计的趋势之一包括使用背景图案，BgPatterns.com 可以帮你设计背景图案，他们有大量可选的图案，可以按不同方式接合，还可以设置透明度。
HTML Encoder

如果你要在网站中显示 Web 代码，那将是非常烦人的事，你必须将诸如 &#60; 一类的符号用编码表示，这个网站可以帮你做这些事情，只需将你的代码复制进去，他们会帮你生成可以直接使用的代码。还有 HTML Decoder [...]<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F18%2Fpro-javascript-techniques-menu%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F25%2Fweb-designer-developer-should-know-15-sites%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Pro Javascript Techniques – 目录</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Fjlutil-for-javascript%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F25%2Fweb-designer-developer-should-know-15-sites%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">jlUtil For Javascript</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2Fjavascript%25E4%25B8%25AD%25E5%2588%25A4%25E6%2596%25AD%25E5%258F%2598%25E9%2587%258F%25E6%2598%25AF%25E5%2590%25A6%25E4%25B8%25BAarray%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F25%2Fweb-designer-developer-should-know-15-sites%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[转]javascript中判断变量是否为array</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2008%2F10%2F02%2Fjavascript%25E5%25AD%25A6%25E4%25B9%25A0%25E7%25AC%2594%25E8%25AE%25B0-%25E7%25B1%25BB%25E7%259A%2584%25E7%25BB%25A7%25E6%2589%25BF%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F25%2Fweb-designer-developer-should-know-15-sites%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript学习笔记–类的继承</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>转一篇cb的好文，以后应该会用到。</p>
<p>公司博客整整一个月没有更新了，最近一段时间，全公司都忙于两件事，为海尔集团做定制，为一个合作伙伴做 OEM，终于有了眉目。工作期间，常用到一些工具与帮助站点，今天读到一篇文章，介绍了15个对 Web 设计与开发师极端有用的站点，里面有不少也是我们一直在使用的，也许对很多人都有用，翻译出来以饷同仁。 		<a href="http://www.colorcombos.com/">ColorCombos</a><br />
<img src="http://www.catswhocode.com/blog/wp-content/uploads/2009/07/colorcombos.png" alt="" /></p>
<p>配色是 Web 设计的首要大事，Color Combos 帮你预备了数千种配色方案，可以根据色调浏览选取。<br />
<a href="http://lipsum.com/">LIpsum</a><br />
<img src="http://www.catswhocode.com/blog/wp-content/uploads/2009/07/lipsum.png" alt="" /></p>
<p>Lorem Ipsum Text 是一中自造的，字典中不存在的单词，是在演示页面结构的时候，需要加文字的地方使用 Lorem Ipsum Text 填充可以避免用户因关注文字的意思而分神。Lipsum.com 可以帮你生成制定数目的 Lorem Ipsum 单词。<br />
<a href="http://new.myfonts.com/whatthefont">What the font?</a><br />
<img src="http://www.catswhocode.com/blog/wp-content/uploads/2009/07/whatthefont.png" alt="" /></p>
<p>有时候你对某个 Logo 感兴趣，想知道是拿什么字体做的，可以将 Logo 图片上传到这个网站，结果之准确会让你难以置信。<br />
<a href="http://www.converticon.com/">ConvertIcon</a><br />
<img src="http://www.catswhocode.com/blog/wp-content/uploads/2009/07/converticon.png" alt="" /></p>
<p>Favicon 越来越受欢迎，尤其随着 Firefox 的流行，Firefox 会将你站点的 Favicon 标志显示在标签上，也会显示于书签，Favicon 支持多种图形格式，比如 png，但 IE 并不支持 png，该站点可以帮助你将 png 等图片格式的 Favicon 转换成 IE 支持的 ico 格式。<br />
<a href="http://www.bgpatterns.com/">BgPatterns</a><br />
<img src="http://www.catswhocode.com/blog/wp-content/uploads/2009/07/bgpatterns.png" alt="" /></p>
<p>现代 Web 设计的趋势之一包括使用背景图案，<em>BgPatterns.com </em>可以帮你设计背景图案，他们有大量可选的图案，可以按不同方式接合，还可以设置透明度。<br />
<a href="http://www.opinionatedgeek.com/DotNet/Tools/HTMLEncode/Encode.aspx">HTML Encoder</a><br />
<img src="http://www.catswhocode.com/blog/wp-content/uploads/2009/07/htmlencoder.png" alt="" /></p>
<p>如果你要在网站中显示 Web 代码，那将是非常烦人的事，你必须将诸如 &lt; 一类的符号用编码表示，这个网站可以帮你做这些事情，只需将你的代码复制进去，他们会帮你生成可以直接使用的代码。还有 <a href="http://www.catswhocode.com/blog/15-sites-web-developers-and-designers-should-know">HTML Decoder</a> 帮你做相反的事。<br />
<a href="http://www.xenocode.com/browsers/">Xenocode Browsers</a><br />
<img src="http://www.catswhocode.com/blog/wp-content/uploads/2009/07/xenocode.png" alt="" /></p>
<p>该网站非常有用，可以直接在站点中预览你的网站在 IE6， IE7， IE8， Firefox 2， Firefox 3， Google Chrome 以及 Opera  中的样子。唯一的不足是，不支持 Mac 和 Linux 环境下的浏览器。<br />
<a href="http://tester.jonasjohn.de/">Test Everything</a><br />
<img src="http://www.catswhocode.com/blog/wp-content/uploads/2009/07/testeverything.png" alt="" /></p>
<p>这个网站包含了超过 100 中工具帮你测试几乎所有东西，如跨浏览器兼容，查 PR 值，甚至帮你验证代码。<br />
<a href="http://spritegen.website-performance.org/">Sprite Generator</a><br />
<img src="http://www.catswhocode.com/blog/wp-content/uploads/2009/07/spritegenerator.png" alt="" /></p>
<p>CSS Sprites 在显著降低 HTTP 请求方面功不可没，但 CSS sprite 可不是个简单的技术，<em>Sprite generator</em> 可以帮你做这些繁复的工作，将你的图片打包成 zip 上传上去，他们会把你的图片组合成 sprite，还帮你生成 CSS 代码。<br />
<a href="http://www.buttonator.com/">Buttonator</a><br />
<img src="http://www.catswhocode.com/blog/wp-content/uploads/2009/07/buttonator.png" alt="" /></p>
<p>这个网站可以帮你设计漂亮的按钮。<br />
<a href="http://loadimpact.com/">Load Impact</a><br />
<img src="http://www.catswhocode.com/blog/wp-content/uploads/2009/07/loadimpact.png" alt="" /></p>
<p>这个压力测试站点可以帮你测试你的站点的抗压能力，如果你的某篇文章曾经上过 Digg 或 StumbleUpon 等网站的首页，你就会知道抗压测试多么重要。<br />
<a href="http://www.iconfinder.net/">IconFinder</a><br />
<img src="http://www.catswhocode.com/blog/wp-content/uploads/2009/07/iconfinder.png" alt="" /></p>
<p>这个网站收藏了大量来自网络的免费图标。<br />
<a href="http://www.typetester.org/">TypeTester</a><br />
<img src="http://www.catswhocode.com/blog/wp-content/uploads/2009/07/typetester.png" alt="" /></p>
<p>该站点可以帮你测试不同字体的显示效果。<br />
<a href="http://csstidy.sourceforge.net/index.php">CSS Tidy</a><br />
<img src="http://www.catswhocode.com/blog/wp-content/uploads/2009/07/csstidy.png" alt="" /></p>
<p>这个站点可以帮你检查 CSS 代码，并修正其中的错误，比如，它可以发现你的 CSS 代码中最常见到重复设置问题。<br />
<a href="http://www.tele-pro.co.uk/scripts/contact_form/">Contact Forms Generators</a><br />
<img src="http://www.catswhocode.com/blog/wp-content/uploads/2009/07/contactformgenerator.png" alt="" /><br />
自定义表单可以帮助你实现同访问者的互动，无需编程，就能快速生成访客反馈表单，甚至帮你生成邮件发送 PHP， ASP， Perl 代码。</p>
<p>本文来源：<a href="http://www.catswhocode.com/blog/15-sites-web-developers-and-designers-should-know">http://www.catswhocode.com/blog/15-sites-web-developers-and-designers-should-know</a><br />
中文翻译来源：<a href="http://www.comsharp.com/">COMSHARP CMS</a> 官方网站</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F18%2Fpro-javascript-techniques-menu%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F25%2Fweb-designer-developer-should-know-15-sites%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Pro Javascript Techniques – 目录</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Fjlutil-for-javascript%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F25%2Fweb-designer-developer-should-know-15-sites%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">jlUtil For Javascript</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2Fjavascript%25E4%25B8%25AD%25E5%2588%25A4%25E6%2596%25AD%25E5%258F%2598%25E9%2587%258F%25E6%2598%25AF%25E5%2590%25A6%25E4%25B8%25BAarray%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F25%2Fweb-designer-developer-should-know-15-sites%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[转]javascript中判断变量是否为array</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2008%2F10%2F02%2Fjavascript%25E5%25AD%25A6%25E4%25B9%25A0%25E7%25AC%2594%25E8%25AE%25B0-%25E7%25B1%25BB%25E7%259A%2584%25E7%25BB%25A7%25E6%2589%25BF%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F25%2Fweb-designer-developer-should-know-15-sites%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript学习笔记–类的继承</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://jennal.cn/2009/07/25/web-designer-developer-should-know-15-sites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>关于Javascript</title>
		<link>http://jennal.cn/2009/07/17/%e5%85%b3%e4%ba%8ejavascript/</link>
		<comments>http://jennal.cn/2009/07/17/%e5%85%b3%e4%ba%8ejavascript/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 13:18:26 +0000</pubDate>
		<dc:creator>Jennal</dc:creator>
				<category><![CDATA[没用的话]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Pro Javascript Technology]]></category>
		<category><![CDATA[翻译]]></category>

		<guid isPermaLink="false">http://jennal.cn/2009/07/17/%e5%85%b3%e4%ba%8ejavascript/</guid>
		<description><![CDATA[最近对JS非常感兴趣，重新拿起jQuery作者John Resig写的《Pro Javascript Technology》的电子书来看，发现有点麻烦，得放到PSP里面看，于是到当当和卓越上搜了一下，发现居然没有中文译本。于是萌生了翻译这本书的想法，我没有做过翻译的工作，更没有翻译过书，只是最近对Javascript很感兴趣，不知道自己能不能坚持下来。
如果有fans来关注，应该可以坚持下来，哈哈
不过希望我的翻译不要引起版权纠纷。
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F18%2Fpro-javascript-techniques-menu%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F17%2F%25E5%2585%25B3%25E4%25BA%258Ejavascript%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Pro Javascript Techniques – 目录</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2008%2F10%2F06%2Fjavascript%25E4%25B8%25AD%25E8%258E%25B7%25E5%258F%2596%25E5%2585%2583%25E7%25B4%25A0%25E7%259A%2584%25E7%25BB%259D%25E5%25AF%25B9%25E4%25BD%258D%25E7%25BD%25AE%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F17%2F%25E5%2585%25B3%25E4%25BA%258Ejavascript%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">JavaScript中获取元素的绝对位置</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2Fjavascript%25E4%25B8%25AD%25E5%2588%25A4%25E6%2596%25AD%25E5%258F%2598%25E9%2587%258F%25E6%2598%25AF%25E5%2590%25A6%25E4%25B8%25BAarray%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F17%2F%25E5%2585%25B3%25E4%25BA%258Ejavascript%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[转]javascript中判断变量是否为array</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F01%2F18%2Fjavascript-%25E5%2588%25B7%25E6%2596%25B0%25E9%25A1%25B5%25E9%259D%25A2%25E7%259A%2584%25E5%2587%25A0%25E7%25A7%258D%25E6%2596%25B9%25E6%25B3%2595%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F17%2F%25E5%2585%25B3%25E4%25BA%258Ejavascript%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript 刷新页面的几种方法</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>最近对JS非常感兴趣，重新拿起jQuery作者John Resig写的《Pro Javascript Technology》的电子书来看，发现有点麻烦，得放到PSP里面看，于是到当当和卓越上搜了一下，发现居然没有中文译本。于是萌生了翻译这本书的想法，我没有做过翻译的工作，更没有翻译过书，只是最近对Javascript很感兴趣，不知道自己能不能坚持下来。</p>
<p>如果有fans来关注，应该可以坚持下来，哈哈<br />
不过希望我的翻译不要引起版权纠纷。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F18%2Fpro-javascript-techniques-menu%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F17%2F%25E5%2585%25B3%25E4%25BA%258Ejavascript%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Pro Javascript Techniques – 目录</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2008%2F10%2F06%2Fjavascript%25E4%25B8%25AD%25E8%258E%25B7%25E5%258F%2596%25E5%2585%2583%25E7%25B4%25A0%25E7%259A%2584%25E7%25BB%259D%25E5%25AF%25B9%25E4%25BD%258D%25E7%25BD%25AE%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F17%2F%25E5%2585%25B3%25E4%25BA%258Ejavascript%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">JavaScript中获取元素的绝对位置</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2Fjavascript%25E4%25B8%25AD%25E5%2588%25A4%25E6%2596%25AD%25E5%258F%2598%25E9%2587%258F%25E6%2598%25AF%25E5%2590%25A6%25E4%25B8%25BAarray%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F17%2F%25E5%2585%25B3%25E4%25BA%258Ejavascript%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[转]javascript中判断变量是否为array</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F01%2F18%2Fjavascript-%25E5%2588%25B7%25E6%2596%25B0%25E9%25A1%25B5%25E9%259D%25A2%25E7%259A%2584%25E5%2587%25A0%25E7%25A7%258D%25E6%2596%25B9%25E6%25B3%2595%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F17%2F%25E5%2585%25B3%25E4%25BA%258Ejavascript%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript 刷新页面的几种方法</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://jennal.cn/2009/07/17/%e5%85%b3%e4%ba%8ejavascript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Javascript Timeout Hacks</title>
		<link>http://jennal.cn/2009/04/24/javascript-timeout-hacks/</link>
		<comments>http://jennal.cn/2009/04/24/javascript-timeout-hacks/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 03:27:18 +0000</pubDate>
		<dc:creator>Jennal</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web前台相关]]></category>
		<category><![CDATA[english]]></category>

		<guid isPermaLink="false">http://jennal.cn/?p=158</guid>
		<description><![CDATA[Our first user script simply displays an alert saying “Hello world!” when it is executed.

Example: Display the “Hello world!” alert
alert('Hello world!');

Although this code looks obvious enough, and does exactly what you would expect, Greasemonkey is actually doing a number of things behind the scenes to ensure that user scripts do not interact badly with other scripts defined [...]<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F01%2F18%2Fjavascript-%25E5%2588%25B7%25E6%2596%25B0%25E9%25A1%25B5%25E9%259D%25A2%25E7%259A%2584%25E5%2587%25A0%25E7%25A7%258D%25E6%2596%25B9%25E6%25B3%2595%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F04%2F24%2Fjavascript-timeout-hacks%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript 刷新页面的几种方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Fjlutil-for-javascript%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F04%2F24%2Fjavascript-timeout-hacks%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">jlUtil For Javascript</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2008%2F10%2F02%2Fjavascript%25E5%25AD%25A6%25E4%25B9%25A0%25E7%25AC%2594%25E8%25AE%25B0-%25E7%25B1%25BB%25E7%259A%2584%25E7%25BB%25A7%25E6%2589%25BF%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F04%2F24%2Fjavascript-timeout-hacks%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript学习笔记–类的继承</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F18%2Fpro-javascript-techniques-menu%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F04%2F24%2Fjavascript-timeout-hacks%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Pro Javascript Techniques – 目录</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>Our first user script simply displays an alert saying “<span class="guilabel">Hello world!</span>” when it is executed.</p>
<div class="example"><a class="skip" title="link to this example" name="example.helloworld.alert" href="http://diveintogreasemonkey.org/helloworld/code.html#example.helloworld.alert"><img title="link to this example" src="http://diveintogreasemonkey.org/images/permalink.gif" alt="[link]" width="8" height="9" /></a></p>
<h3 class="title">Example: Display the “<span class="guilabel">Hello world!</span>” alert</h3>
<pre class="programlisting"><span style="color: #0000ff;">alert</span>(<span style="color: #880000;">'Hello world!'</span>);</pre>
</div>
<p>Although this code looks obvious enough, and does exactly what you would expect, Greasemonkey is actually doing a number of things behind the scenes to ensure that user scripts do not interact badly with other scripts defined by the original page. Specifically, it automatically wraps your user script in an anonymous function wrapper. Ordinarily you can ignore this, but it will eventually creep up and bite you in the ass, so you may as well learn about it now.</p>
<p>One of the most common ways this can bite you is that variables and functions that you define in a user script are <span class="emphasis"><em>not</em></span> available to other scripts.  In fact, they are not available at all once the user script has finished running.  This means                   that you will run into problems if you are expecting to be able to call your own functions later by using the <code class="methodname">window.setTimeout</code> function, or by setting string-based <code class="systemitem">onclick</code> attributes on links and expecting Javascript to evaluate your function names later.</p>
<p>For example, this user script defines a function <code class="function">helloworld</code>, then attempts to set a timer to call it one second later.</p>
<div class="example"><a class="skip" title="link to this example" name="example.settimeout.bad" href="http://diveintogreasemonkey.org/helloworld/code.html#example.settimeout.bad"><img title="link to this example" src="http://diveintogreasemonkey.org/images/permalink.gif" alt="[link]" width="8" height="9" /></a></p>
<h3 class="title">Example: Bad way to delay calling a function</h3>
<pre class="programlisting"><span style="color: #0000ff;">function</span> helloworld() {
    <span style="color: #0000ff;">alert</span>(<span style="color: #880000;">'Hello world!'</span>);
}

<span style="color: #00aa00;">window</span>.<span style="color: #00aa00;">setTimeout</span>(<span style="color: #880000;">"helloworld()"</span>, <span style="color: #880000;">60</span>);</pre>
<p>This will not work; no alert will be displayed.  If you open <a title="3.1. Tracking crashes with JavaScript Console" href="http://diveintogreasemonkey.org/debug/javascript-console.html">JavaScript Console</a>, you will see an exception displayed: <code class="computeroutput">Error: helloworld is not defined.</code> This is because, by the time the timeout expires and the call to <code class="literal">helloworld()</code> is evaluated, the <code class="function">helloworld</code> function no longer exists.</div>
<p>If you need to reference your user script&#8217;s variables or functions later, you will need to explicitly define them as properties                   of the <code class="varname">window</code> object, which is always available.</p>
<div class="example"><a class="skip" title="link to this example" name="example.settimeout.better" href="http://diveintogreasemonkey.org/helloworld/code.html#example.settimeout.better"><img title="link to this example" src="http://diveintogreasemonkey.org/images/permalink.gif" alt="[link]" width="8" height="9" /></a></p>
<h3 class="title">Example: Better way to delay calling a function</h3>
<pre class="programlisting"><span style="color: #00aa00;">window</span>.helloworld = <span style="color: #0000ff;">function</span>() {
    <span style="color: #0000ff;">alert</span>(<span style="color: #880000;">'Hello world!'</span>);
}

<span style="color: #00aa00;">window</span>.<span style="color: #00aa00;">setTimeout</span>(<span style="color: #880000;">"helloworld()"</span>, <span style="color: #880000;">60</span>);</pre>
<p>This works as expected: one second after the page loads, an alert pops up proudly displaying “<span class="guilabel">Hello world!</span>”</div>
<p>However, setting properties on <code class="varname">window</code> is still not ideal; it&#8217;s a bit like using a global variable when a local one will do.  (Actually, it&#8217;s exactly like that,                   since <code class="varname">window</code> is global and available to all scripts on the page.)  More practically, you could end up interfering with other scripts that                   were defined on the page, or even other user scripts.</p>
<p>The best solution is to define an anonymous function yourself and pass it as the first argument to <code class="function">window.setTimeout</code>.</p>
<div class="example"><a class="skip" title="link to this example" name="example.settimeout.best" href="http://diveintogreasemonkey.org/helloworld/code.html#example.settimeout.best"><img title="link to this example" src="http://diveintogreasemonkey.org/images/permalink.gif" alt="[link]" width="8" height="9" /></a></p>
<h3 class="title">Example: Best way to delay calling a function</h3>
<pre class="programlisting"><span style="color: #00aa00;">window</span>.<span style="color: #00aa00;">setTimeout</span>(<span style="color: #0000ff;">function</span>() { <span style="color: #0000ff;">alert</span>(<span style="color: #880000;">'Hello world!'</span>) }, <span style="color: #880000;">60</span>);</pre>
<p>What I&#8217;m doing here is creating a function without a name (an “<span class="quote">anonymous function</span>”), then immediately passing the function itself to <code class="function">window.setTimeout</code>.  This accomplishes the same thing as the previous example, but it leaves no trace, i.e. it&#8217;s undetectable to other scripts.</p>
<p>I find that I use anonymous functions regularly while writing user scripts.  They are ideal for creating “<span class="quote">one-off</span>” functions and passing them as arguments to things like <code class="function">window.setTimeout</code>, <code class="function">document.addEventListener</code>, or assigning to event handlers like <code class="systemitem">click</code> or <code class="systemitem">submit</code>.</div>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F01%2F18%2Fjavascript-%25E5%2588%25B7%25E6%2596%25B0%25E9%25A1%25B5%25E9%259D%25A2%25E7%259A%2584%25E5%2587%25A0%25E7%25A7%258D%25E6%2596%25B9%25E6%25B3%2595%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F04%2F24%2Fjavascript-timeout-hacks%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript 刷新页面的几种方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Fjlutil-for-javascript%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F04%2F24%2Fjavascript-timeout-hacks%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">jlUtil For Javascript</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2008%2F10%2F02%2Fjavascript%25E5%25AD%25A6%25E4%25B9%25A0%25E7%25AC%2594%25E8%25AE%25B0-%25E7%25B1%25BB%25E7%259A%2584%25E7%25BB%25A7%25E6%2589%25BF%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F04%2F24%2Fjavascript-timeout-hacks%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript学习笔记–类的继承</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F18%2Fpro-javascript-techniques-menu%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F04%2F24%2Fjavascript-timeout-hacks%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Pro Javascript Techniques – 目录</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://jennal.cn/2009/04/24/javascript-timeout-hacks/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title></title>
		<link>http://jennal.cn/2009/01/31/125/</link>
		<comments>http://jennal.cn/2009/01/31/125/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 12:58:58 +0000</pubDate>
		<dc:creator>Jennal</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web前台相关]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://jennal.cn/?p=125</guid>
		<description><![CDATA[略懂 HTML 的朋友都知道，如果想让一个链接在新窗口中打开，通常的做法是利用 target=”_blank” 来设定 a 标签。例如：


&#60;a href=&#8220;http://jennal.cn&#8220; target=&#8220;_blank&#8220;&#62;Jennal.cn&#60;/a&#62;


这种做法确实比较方便，但在 XHTML 1.0 Strict 中去掉了 target 属性，也就是说我们不能再利用 target 属性来控制链接的行为。虽然当今流行的浏览器在 XHTML 1.0 Strict 甚至 XHTML 1.1 下扔能正确执行 target=”_blank”，但这样的代码毕竟是不规范的，不推荐使用。
很自然，我们会想到用 Javascript 来解决这个问题，我通常是使用下面的方法：


&#60;a href=&#8220;http://jennal.cn&#8220; onclick=&#8220;window.open(this.href);return false;&#8220;&#62;Jennal.cn&#60;/a&#62;


这样虽然可以满足要求，但是当链接很多的时候，代码就显得有些臃肿了。为了简化代码，我们应该用 DOM Event / DHTML 的方法来解决这个问题。今天我恰好在做一个网页，需要使用 XHTML 1.0 Strict，准备自己写一个这样的 Javascript。不过幸好我养成了万事先 Google 的坏习惯，还真让我找到了一个很完善的 Javascript 弹窗代码，这段代码不仅写的漂亮，通用性强，而且还考虑到了当今流行的浏览器按下组合键点击链接的情况，已经非常完善了。代码源头在这里，作者提供了源码下载和一个演示。
这段代码的通用性非常强，作者原文中举例写的也很详细，其实最简单的用法就是为需要开新窗的链接添加 rel=”external” 属性，当然，你也可以自己定制根据 class 或其它什么属性来判断。


&#60;a href=&#8220;http://jennal.cn&#8220; rel=&#8220;external&#8220;&#62;Jennal.cn&#60;/a&#62;


当然，在网页设计中，弹出新窗口在多数情况下应该尽量避免，只在可以提高用户体验的情况下才需要使用。此外，由于有些 Pop Window Blocker 会拦截 Javascript 弹出窗口，我们可以修改这段代码，通过判断窗口是否成功建立来给出关闭弹窗过滤的提示，相信可以使用户体验提升不少。
转自：http://blog.istef.info/2007/05/17/open-a-new-window-when-click-a-link-under-xhtml-10-strict/
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2Fjavascript%25E4%25B8%25AD%25E5%2588%25A4%25E6%2596%25AD%25E5%258F%2598%25E9%2587%258F%25E6%2598%25AF%25E5%2590%25A6%25E4%25B8%25BAarray%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F01%2F31%2F125%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[转]javascript中判断变量是否为array</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2008%2F10%2F06%2Fjavascript%25E4%25B8%25AD%25E8%258E%25B7%25E5%258F%2596%25E5%2585%2583%25E7%25B4%25A0%25E7%259A%2584%25E7%25BB%259D%25E5%25AF%25B9%25E4%25BD%258D%25E7%25BD%25AE%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F01%2F31%2F125%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">JavaScript中获取元素的绝对位置</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Fjlutil-for-javascript%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F01%2F31%2F125%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">jlUtil For Javascript</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F18%2Fpro-javascript-techniques-menu%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F01%2F31%2F125%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Pro Javascript Techniques – 目录</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>略懂 HTML 的朋友都知道，如果想让一个链接在新窗口中打开，通常的做法是利用 target=”_blank” 来设定 a 标签。例如：</p>
<div class="hl-surround">
<ol class="hl-main ln-show" title="Double click to hide line number." ondblclick="linenumber(this)">
<li class="hl-firstline"><span style="color: olive;">&lt;</span><span style="color: green;">a</span><span style="color: gray;"> </span><span style="color: #00008b;">href</span><span style="color: gray;">=</span><span style="color: #8b0000;">&#8220;</span><span style="color: red;">http://jennal.cn</span><span style="color: #8b0000;">&#8220;</span><span style="color: gray;"> </span><span style="color: #00008b;">target</span><span style="color: gray;">=</span><span style="color: #8b0000;">&#8220;</span><span style="color: red;">_blank</span><span style="color: #8b0000;">&#8220;</span><span style="color: olive;">&gt;<span style="color: gray;">Jennal.cn</span></span><span style="color: gray;"></span><span style="color: olive;">&lt;/</span><span style="color: green;">a</span><span style="color: olive;">&gt;</span></li>
</ol>
</div>
<p>这种做法确实比较方便，但在 XHTML 1.0 Strict 中去掉了 target 属性，也就是说我们不能再利用 target 属性来控制链接的行为。虽然当今流行的浏览器在 XHTML 1.0 Strict 甚至 XHTML 1.1 下扔能正确执行 target=”_blank”，但这样的代码毕竟是不规范的，不推荐使用。</p>
<p>很自然，我们会想到用 Javascript 来解决这个问题，我通常是使用下面的方法：</p>
<div class="hl-surround">
<ol class="hl-main ln-show" title="Double click to hide line number." ondblclick="linenumber(this)">
<li class="hl-firstline"><span style="color: olive;">&lt;</span><span style="color: green;">a</span><span style="color: gray;"> </span><span style="color: #00008b;">href</span><span style="color: gray;">=</span><span style="color: #8b0000;">&#8220;</span><span style="color: red;">http://<span style="color: #8b0000;">jennal.cn</span></span><span style="color: #8b0000;">&#8220;</span><span style="color: gray;"> </span><span style="color: #00008b;">onclick</span><span style="color: gray;">=</span><span style="color: #8b0000;">&#8220;</span><span style="color: red;">window.open(this.href);return false;</span><span style="color: #8b0000;">&#8220;</span><span style="color: olive;">&gt;<span style="color: gray;">Jennal.cn</span></span><span style="color: gray;"></span><span style="color: olive;">&lt;/</span><span style="color: green;">a</span><span style="color: olive;">&gt;</span></li>
</ol>
</div>
<p>这样虽然可以满足要求，但是当链接很多的时候，代码就显得有些臃肿了。为了简化代码，我们应该用 DOM Event / DHTML 的方法来解决这个问题。今天我恰好在做一个网页，需要使用 XHTML 1.0 Strict，准备自己写一个这样的 Javascript。不过幸好我养成了万事先 Google 的坏习惯，还真让我找到了一个很完善的 Javascript 弹窗代码，这段代码不仅写的漂亮，通用性强，而且还考虑到了当今流行的浏览器按下组合键点击链接的情况，已经非常完善了。代码源头在<a href="http://www.456bereastreet.com/archive/200610/opening_new_windows_with_javascript_version_12/">这里</a>，作者提供了源码下载和一个<a href="http://www.456bereastreet.com/lab/javascript-target/1.2/">演示</a>。</p>
<p>这段代码的通用性非常强，作者原文中举例写的也很详细，其实最简单的用法就是为需要开新窗的链接添加 rel=”external” 属性，当然，你也可以自己定制根据 class 或其它什么属性来判断。</p>
<div class="hl-surround">
<ol class="hl-main ln-show" title="Double click to hide line number." ondblclick="linenumber(this)">
<li class="hl-firstline"><span style="color: olive;">&lt;</span><span style="color: green;">a</span><span style="color: gray;"> </span><span style="color: #00008b;">href</span><span style="color: gray;">=</span><span style="color: #8b0000;">&#8220;</span><span style="color: red;">http://jennal.cn</span><span style="color: #8b0000;">&#8220;</span><span style="color: gray;"> </span><span style="color: #00008b;">rel</span><span style="color: gray;">=</span><span style="color: #8b0000;">&#8220;</span><span style="color: red;">external</span><span style="color: #8b0000;">&#8220;</span><span style="color: olive;">&gt;<span style="color: gray;">Jennal.cn</span></span><span style="color: gray;"></span><span style="color: olive;">&lt;/</span><span style="color: green;">a</span><span style="color: olive;">&gt;</span></li>
</ol>
</div>
<p>当然，在网页设计中，弹出新窗口在多数情况下应该尽量避免，只在可以提高用户体验的情况下才需要使用。此外，由于有些 Pop Window Blocker 会拦截 Javascript 弹出窗口，我们可以修改这段代码，通过判断窗口是否成功建立来给出关闭弹窗过滤的提示，相信可以使用户体验提升不少。</p>
<p>转自：http://blog.istef.info/2007/05/17/open-a-new-window-when-click-a-link-under-xhtml-10-strict/</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2Fjavascript%25E4%25B8%25AD%25E5%2588%25A4%25E6%2596%25AD%25E5%258F%2598%25E9%2587%258F%25E6%2598%25AF%25E5%2590%25A6%25E4%25B8%25BAarray%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F01%2F31%2F125%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[转]javascript中判断变量是否为array</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2008%2F10%2F06%2Fjavascript%25E4%25B8%25AD%25E8%258E%25B7%25E5%258F%2596%25E5%2585%2583%25E7%25B4%25A0%25E7%259A%2584%25E7%25BB%259D%25E5%25AF%25B9%25E4%25BD%258D%25E7%25BD%25AE%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F01%2F31%2F125%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">JavaScript中获取元素的绝对位置</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Fjlutil-for-javascript%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F01%2F31%2F125%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">jlUtil For Javascript</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F18%2Fpro-javascript-techniques-menu%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F01%2F31%2F125%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Pro Javascript Techniques – 目录</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://jennal.cn/2009/01/31/125/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Javascript 刷新页面的几种方法</title>
		<link>http://jennal.cn/2009/01/18/javascript-%e5%88%b7%e6%96%b0%e9%a1%b5%e9%9d%a2%e7%9a%84%e5%87%a0%e7%a7%8d%e6%96%b9%e6%b3%95/</link>
		<comments>http://jennal.cn/2009/01/18/javascript-%e5%88%b7%e6%96%b0%e9%a1%b5%e9%9d%a2%e7%9a%84%e5%87%a0%e7%a7%8d%e6%96%b9%e6%b3%95/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 13:43:21 +0000</pubDate>
		<dc:creator>Jennal</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web前台相关]]></category>
		<category><![CDATA[reload]]></category>

		<guid isPermaLink="false">http://jennal.cn/?p=117</guid>
		<description><![CDATA[1    history.go(0)
2    location.reload()
3    location=location
4    location.assign(location)
5    document.execCommand(&#8216;Refresh&#8217;)
6    window.navigate(location)
7    location.replace(location)
8    document.URL=location.href
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2008%2F10%2F06%2Fjavascript%25E4%25B8%25AD%25E8%258E%25B7%25E5%258F%2596%25E5%2585%2583%25E7%25B4%25A0%25E7%259A%2584%25E7%25BB%259D%25E5%25AF%25B9%25E4%25BD%258D%25E7%25BD%25AE%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F01%2F18%2Fjavascript-%25E5%2588%25B7%25E6%2596%25B0%25E9%25A1%25B5%25E9%259D%25A2%25E7%259A%2584%25E5%2587%25A0%25E7%25A7%258D%25E6%2596%25B9%25E6%25B3%2595%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">JavaScript中获取元素的绝对位置</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F04%2F24%2Fjavascript-timeout-hacks%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F01%2F18%2Fjavascript-%25E5%2588%25B7%25E6%2596%25B0%25E9%25A1%25B5%25E9%259D%25A2%25E7%259A%2584%25E5%2587%25A0%25E7%25A7%258D%25E6%2596%25B9%25E6%25B3%2595%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript Timeout Hacks</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F18%2Fpro-javascript-techniques-menu%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F01%2F18%2Fjavascript-%25E5%2588%25B7%25E6%2596%25B0%25E9%25A1%25B5%25E9%259D%25A2%25E7%259A%2584%25E5%2587%25A0%25E7%25A7%258D%25E6%2596%25B9%25E6%25B3%2595%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Pro Javascript Techniques – 目录</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2Fjavascript%25E4%25B8%25AD%25E5%2588%25A4%25E6%2596%25AD%25E5%258F%2598%25E9%2587%258F%25E6%2598%25AF%25E5%2590%25A6%25E4%25B8%25BAarray%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F01%2F18%2Fjavascript-%25E5%2588%25B7%25E6%2596%25B0%25E9%25A1%25B5%25E9%259D%25A2%25E7%259A%2584%25E5%2587%25A0%25E7%25A7%258D%25E6%2596%25B9%25E6%25B3%2595%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[转]javascript中判断变量是否为array</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>1    history.go(0)<br />
2    location.reload()<br />
3    location=location<br />
4    location.assign(location)<br />
5    document.execCommand(&#8216;Refresh&#8217;)<br />
6    window.navigate(location)<br />
7    location.replace(location)<br />
8    document.URL=location.href</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2008%2F10%2F06%2Fjavascript%25E4%25B8%25AD%25E8%258E%25B7%25E5%258F%2596%25E5%2585%2583%25E7%25B4%25A0%25E7%259A%2584%25E7%25BB%259D%25E5%25AF%25B9%25E4%25BD%258D%25E7%25BD%25AE%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F01%2F18%2Fjavascript-%25E5%2588%25B7%25E6%2596%25B0%25E9%25A1%25B5%25E9%259D%25A2%25E7%259A%2584%25E5%2587%25A0%25E7%25A7%258D%25E6%2596%25B9%25E6%25B3%2595%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">JavaScript中获取元素的绝对位置</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F04%2F24%2Fjavascript-timeout-hacks%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F01%2F18%2Fjavascript-%25E5%2588%25B7%25E6%2596%25B0%25E9%25A1%25B5%25E9%259D%25A2%25E7%259A%2584%25E5%2587%25A0%25E7%25A7%258D%25E6%2596%25B9%25E6%25B3%2595%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript Timeout Hacks</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F18%2Fpro-javascript-techniques-menu%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F01%2F18%2Fjavascript-%25E5%2588%25B7%25E6%2596%25B0%25E9%25A1%25B5%25E9%259D%25A2%25E7%259A%2584%25E5%2587%25A0%25E7%25A7%258D%25E6%2596%25B9%25E6%25B3%2595%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Pro Javascript Techniques – 目录</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2010%2F02%2F23%2Fjavascript%25E4%25B8%25AD%25E5%2588%25A4%25E6%2596%25AD%25E5%258F%2598%25E9%2587%258F%25E6%2598%25AF%25E5%2590%25A6%25E4%25B8%25BAarray%2F&from=http%3A%2F%2Fjennal.cn%2F2009%2F01%2F18%2Fjavascript-%25E5%2588%25B7%25E6%2596%25B0%25E9%25A1%25B5%25E9%259D%25A2%25E7%259A%2584%25E5%2587%25A0%25E7%25A7%258D%25E6%2596%25B9%25E6%25B3%2595%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[转]javascript中判断变量是否为array</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://jennal.cn/2009/01/18/javascript-%e5%88%b7%e6%96%b0%e9%a1%b5%e9%9d%a2%e7%9a%84%e5%87%a0%e7%a7%8d%e6%96%b9%e6%b3%95/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JQuery基础范例 (掌握元素的定位及大小)</title>
		<link>http://jennal.cn/2008/10/06/jquery%e5%9f%ba%e7%a1%80%e8%8c%83%e4%be%8b-%e6%8e%8c%e6%8f%a1%e5%85%83%e7%b4%a0%e7%9a%84%e5%ae%9a%e4%bd%8d%e5%8f%8a%e5%a4%a7%e5%b0%8f/</link>
		<comments>http://jennal.cn/2008/10/06/jquery%e5%9f%ba%e7%a1%80%e8%8c%83%e4%be%8b-%e6%8e%8c%e6%8f%a1%e5%85%83%e7%b4%a0%e7%9a%84%e5%ae%9a%e4%bd%8d%e5%8f%8a%e5%a4%a7%e5%b0%8f/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 02:57:36 +0000</pubDate>
		<dc:creator>Jennal</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web前台相关]]></category>

		<guid isPermaLink="false">http://jennal.cn/?p=36</guid>
		<description><![CDATA[http://jsgears.com/thread-76-1-1.html
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F17%2F%25E5%2585%25B3%25E4%25BA%258Ejavascript%2F&from=http%3A%2F%2Fjennal.cn%2F2008%2F10%2F06%2Fjquery%25E5%259F%25BA%25E7%25A1%2580%25E8%258C%2583%25E4%25BE%258B-%25E6%258E%258C%25E6%258F%25A1%25E5%2585%2583%25E7%25B4%25A0%25E7%259A%2584%25E5%25AE%259A%25E4%25BD%258D%25E5%258F%258A%25E5%25A4%25A7%25E5%25B0%258F%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">关于Javascript</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F04%2F24%2Fjavascript-timeout-hacks%2F&from=http%3A%2F%2Fjennal.cn%2F2008%2F10%2F06%2Fjquery%25E5%259F%25BA%25E7%25A1%2580%25E8%258C%2583%25E4%25BE%258B-%25E6%258E%258C%25E6%258F%25A1%25E5%2585%2583%25E7%25B4%25A0%25E7%259A%2584%25E5%25AE%259A%25E4%25BD%258D%25E5%258F%258A%25E5%25A4%25A7%25E5%25B0%258F%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript Timeout Hacks</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F18%2Fpro-javascript-techniques-menu%2F&from=http%3A%2F%2Fjennal.cn%2F2008%2F10%2F06%2Fjquery%25E5%259F%25BA%25E7%25A1%2580%25E8%258C%2583%25E4%25BE%258B-%25E6%258E%258C%25E6%258F%25A1%25E5%2585%2583%25E7%25B4%25A0%25E7%259A%2584%25E5%25AE%259A%25E4%25BD%258D%25E5%258F%258A%25E5%25A4%25A7%25E5%25B0%258F%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Pro Javascript Techniques – 目录</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Fjlutil-for-javascript%2F&from=http%3A%2F%2Fjennal.cn%2F2008%2F10%2F06%2Fjquery%25E5%259F%25BA%25E7%25A1%2580%25E8%258C%2583%25E4%25BE%258B-%25E6%258E%258C%25E6%258F%25A1%25E5%2585%2583%25E7%25B4%25A0%25E7%259A%2584%25E5%25AE%259A%25E4%25BD%258D%25E5%258F%258A%25E5%25A4%25A7%25E5%25B0%258F%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">jlUtil For Javascript</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p><a href="http://jsgears.com/thread-76-1-1.html">http://jsgears.com/thread-76-1-1.html</a></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F17%2F%25E5%2585%25B3%25E4%25BA%258Ejavascript%2F&from=http%3A%2F%2Fjennal.cn%2F2008%2F10%2F06%2Fjquery%25E5%259F%25BA%25E7%25A1%2580%25E8%258C%2583%25E4%25BE%258B-%25E6%258E%258C%25E6%258F%25A1%25E5%2585%2583%25E7%25B4%25A0%25E7%259A%2584%25E5%25AE%259A%25E4%25BD%258D%25E5%258F%258A%25E5%25A4%25A7%25E5%25B0%258F%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">关于Javascript</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F04%2F24%2Fjavascript-timeout-hacks%2F&from=http%3A%2F%2Fjennal.cn%2F2008%2F10%2F06%2Fjquery%25E5%259F%25BA%25E7%25A1%2580%25E8%258C%2583%25E4%25BE%258B-%25E6%258E%258C%25E6%258F%25A1%25E5%2585%2583%25E7%25B4%25A0%25E7%259A%2584%25E5%25AE%259A%25E4%25BD%258D%25E5%258F%258A%25E5%25A4%25A7%25E5%25B0%258F%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Javascript Timeout Hacks</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F18%2Fpro-javascript-techniques-menu%2F&from=http%3A%2F%2Fjennal.cn%2F2008%2F10%2F06%2Fjquery%25E5%259F%25BA%25E7%25A1%2580%25E8%258C%2583%25E4%25BE%258B-%25E6%258E%258C%25E6%258F%25A1%25E5%2585%2583%25E7%25B4%25A0%25E7%259A%2584%25E5%25AE%259A%25E4%25BD%258D%25E5%258F%258A%25E5%25A4%25A7%25E5%25B0%258F%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Pro Javascript Techniques – 目录</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjennal.cn%2F2009%2F07%2F31%2Fjlutil-for-javascript%2F&from=http%3A%2F%2Fjennal.cn%2F2008%2F10%2F06%2Fjquery%25E5%259F%25BA%25E7%25A1%2580%25E8%258C%2583%25E4%25BE%258B-%25E6%258E%258C%25E6%258F%25A1%25E5%2585%2583%25E7%25B4%25A0%25E7%259A%2584%25E5%25AE%259A%25E4%25BD%258D%25E5%258F%258A%25E5%25A4%25A7%25E5%25B0%258F%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">jlUtil For Javascript</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://jennal.cn/2008/10/06/jquery%e5%9f%ba%e7%a1%80%e8%8c%83%e4%be%8b-%e6%8e%8c%e6%8f%a1%e5%85%83%e7%b4%a0%e7%9a%84%e5%ae%9a%e4%bd%8d%e5%8f%8a%e5%a4%a7%e5%b0%8f/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

