<?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>王魏前端博客</title>
	<atom:link href="http://www.weiking.com.cn/feed" rel="self" type="application/rss+xml" />
	<link>http://www.weiking.com.cn</link>
	<description>关注网站前端，记录互联网，享受我的生活</description>
	<lastBuildDate>Thu, 22 Dec 2011 03:19:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>html5 新增语义化标签</title>
		<link>http://www.weiking.com.cn/post/704.html</link>
		<comments>http://www.weiking.com.cn/post/704.html#comments</comments>
		<pubDate>Mon, 05 Dec 2011 12:10:37 +0000</pubDate>
		<dc:creator>weiking</dc:creator>
				<category><![CDATA[html]]></category>
		<category><![CDATA[html5标签]]></category>
		<category><![CDATA[html5语义化标签]]></category>

		<guid isPermaLink="false">http://www.weiking.com.cn/?p=704</guid>
		<description><![CDATA[Html5与html相比，有哪些特点：

一.首先是标签部分的简洁:

1.声明部分简洁化，之前，我们分为声明又臭又长, 不知道你能敲下来不，反正我不行，这是w3school的文档。

1.声明部分简洁化，之前，我们分为声明又臭又长, 不知道你能敲下来不，反正我不行，这是w3school的文档。

a.XHTML Strict DTD 如果您需要干净的标记，免于表现层的混乱，请使用此类型。

<span class="readmore"><a href="http://www.weiking.com.cn/post/704.html" title="html5 新增语义化标签">阅读全文——共4519字</a></span>]]></description>
			<content:encoded><![CDATA[<p>Html5与html相比，有哪些特点：</p>
<p>一.首先是标签部分的简洁:</p>
<p>1.声明部分简洁化，之前，我们分为声明又臭又长, 不知道你能敲下来不，反正我不行，这是w3school的文档。</p>
<p>1.<!DOCTYPE>声明部分简洁化，之前，我们分为声明又臭又长, 不知道你能敲下来不，反正我不行，这是w3school的文档。<br />
a.XHTML Strict DTD 如果您需要干净的标记，免于表现层的混乱，请使用此类型。</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE html</span>
<span style="color: #00bbdd;">PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;</span>
<span style="color: #00bbdd;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;</span></pre></div></div>

<p>b.XHTML Transitional DTD Transitional DTD 可包含 W3C 所期望移入样式表的呈现属性和元素。如果您的读者使用了不支持层叠样式表（CSS）的浏览器以至于您不得不使用 XHTML 的呈现特性时，请使用此类型：</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE html</span>
<span style="color: #00bbdd;">PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span>
<span style="color: #00bbdd;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</span></pre></div></div>

<p>c.XHTML Frameset DTD 当您希望使用框架时，请使用此 DTD！</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE html</span>
<span style="color: #00bbdd;">PUBLIC &quot;-//W3C//DTD XHTML 1.0 Frameset//EN&quot;</span>
<span style="color: #00bbdd;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd&quot;&gt;</span></pre></div></div>

<p>2.增加Html5语义化标签：<br />
header: 此元素用于定义 Web 页面的某些部分的标题，可以是整个页面、article 元素或 section 元素。<br />
footer:与 header 元素类似，此新元素定义页面的某些部分的页脚。页脚不一定是在页面、文章或区域的结尾，但是它通常是在那个位置。<br />
nav: 这是 Web 页面上主要导航链接的容器。此元素不应用于所有链接组，而是应仅用于主要导航块。如果您有一个 footer元素包含导航链接，不需要将这些链接封装在 nav 元素中，因为 footer 元素将可以独自包括这些链接。<br />
article: 元素用于定义页面上可以独自分布的独立项目，例如新闻项目、博客或评论。此类项目通常使用 RSS feed 来联合。<br />
section: 此元素表示文档或应用程序的一部分，例如，文章或教程的一章或一节。例如，您现在正在阅读的章节在 HTML5 中可以使用 section 元素括起来。section 元素通常具有一个页眉，虽然严格来说是不需要的。例如，您现在正在阅读的章节的页眉将包含文本 “语义元素”。<br />
aside: 此新元素可以用于标记边栏或一些将认为与其周围内容有点无关的内容。此项的一个例子就是广告块。<br />
hgroup: 在某些情况下，页面、文章或区域可能需要多个标题，例如，您有一个标题和一个副标题。例如，本教程具有标题 “使用 HTML5 和 CSS3 创建现代 Web 站点” 和副标题 “在 HTML5 中实施 canvas 和 video 元素”。您可以在 hgroup 元素中封装这些标题，使用 h1 元素表示主标题，h2 元素表示副标题。 </p>
<p>除此之外，还有 audio 和 video 元素用来替代 Web 当前对 Flash 作为一种多媒体交付平台的依赖 </p>
<p>canvas 元素: 最初是由 Apple® 开发的，用于 Mac OS X Dashboard 部件和 Safari 中，但是后来被 Mozilla® 和 Opera® 用于它们的 Web 浏览器中。该元素已经被标准化并与一系列 2D 绘图 API 包括在 HTML5 规范中，这些 API可以用于创建该元素内的形状、文本、过渡和动画。 </p>
<p>许多人相信 canvas 元素是 HTML5 最重要的一个方面，因为它可以促进快速创建图表、交互式游戏、绘图应用程序以及其他图形，而无需 Adobe Flash 等外部插件。<br />
canvas 元素自身是非常基础的，定义对象的宽度、高度和惟一 ID。然后，开发人员必须使用一系列 JavaScript API 在 canvas 实际绘制对象，通常是在 Web 页面已经完成了呈现后。这些 API 允许开发人员绘制形状和线条；应用颜色、不透明性以及倾斜度；转换 canvas 对象；以及执行动画。这些 API 还允许 canvas 成为交互式的并对鼠标操作和键操作等用户输入做出响应，从而促进在 canvas 上创建游戏和 Web 应用程序。 </p>
<p>使用 audio 和 video</p>
<p>使用 二：这是一个标准的Html5化页面。 </p>
<pre class="brush: plain; title: ; notranslate">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;meta charset=&quot;utf-8&quot;&gt;
    &lt;title&gt;html5&lt;/title&gt;
    &lt;style&gt;
        body {
            background: #CCC;
            font-family: Geneva,Arial,Helvetica,sans-serif;
            margin: 0 auto;
            /*max-width: 900px;*/
            border: 1px solid #FFF;
        }

        h1, h2, h3, h4 {
            margin: 0;
        }

        heder {
            background: #F47D31;
            color: #FFF;
            text-align: center;
            display: block;
        }

        h1,h2,h3,h4 {
            text-align: center;
            color: #F47D31;
        }

        h1 {
            font-size: 72px;
        }

        h2 {
            font-size: 24px;
        }

        h3 {
            font-size: 18px;
        }

        h4 {
            background: #FFF;
            position: absolute;
            padding: 0 150px;
            top: 50px;
            left: -120px;
            -webkit-box-shadow: 2px 2px 20px #888;
            -webkit-transform: rotate(-45deg);
            -moz-box-show: 2px 2px 20px #888;
            -moz-transform: rotate(-45deg);
        }

        #container {
            background: #888;
        }

        nav {
            display: block;
            width: 25%;
            float: left;
        }

        nav a:link, nav a:visited {
            border-bottom: 3px solid #FFF;
            padding: 10px;
            text-decoration: none;
            font-weight: bold;
            margin: 5px;
            display: block;
        }

        nav a:hover {
            color: white;
            background: #F47D31;
        }

        nav h3 {
            margin: 15px;
            color: white;
        }

        section {
            width: 50%;
            float: left;
            display: block;
        }

        article {
            background: #EEE;
            margin: 10px;
            padding: 10px;
            display: block;
            -webkit-border-radius: 10px;    /*webkit圆角*/
            -moz-border-radius: 10px;       /*moz圆角*/
            border-radius: 10px;
            -webkit-box-shadow: 2px 2px 20px #888;  /*webkit阴影*/
            /*-webkit-transform: rotate(-10deg);*/      /*webkit旋转*/
            -moz-box-shadow: 2px 2px 20px #888;     /*moz圆角*/
            /*-moz-transform: rotate(-10deg);*/         /*moz阴影*/
        }

        article header, article footer {
            -webkit-border-radius: 10px;
            -moz-border-radius: 10px;
            border-radius: 10px;
            padding: 5px;
            background: #F47D31;
        }

        article h1 {
            color: white;
            font-size: 18px;
        }

        aside {
            width: 25%;
            float: left;
            display: block;
        }

        aside h3 {
            margin: 15px;
            color: white;
        }

        aside p {
            margin: 15px;
            color:　white;
            font-weight: bold;
            font-style: italic;
        }

        footer {
            clear: both;
            display: block;
            background: #F47D31;
            color: #FFF;
            text-align: center;
            padding: 15px;
        }

        footer h2 {
            font-size: 14px;
            color: white;
        }

    &lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
    &lt;!--header标记头部区域的内容--&gt;
    &lt;header&gt;
        &lt;h1&gt;Header&lt;/h1&gt;
        &lt;h2&gt;Subtitle&lt;/h2&gt;
        &lt;h4&gt;HTML5 Rocks&lt;/h4&gt;
    &lt;/header&gt;
    &lt;!--主体内容--&gt;
    &lt;div id=&quot;container&quot;&gt;

        &lt;!--导航--&gt;
        &lt;nav&gt;
            &lt;h3&gt;Nav&lt;/h3&gt;
            &lt;a href=&quot;http://www.baidu.com&quot;&gt;Link1&lt;/a&gt;
            &lt;a href=&quot;http://www.qq.com&quot;&gt;Link2&lt;/a&gt;
            &lt;a href=&quot;http://www.163.com&quot;&gt;Link3&lt;/a&gt;
        &lt;/nav&gt;

        &lt;!--web中的某区域--&gt;
        &lt;section&gt;
            &lt;article&gt;
                &lt;header&gt;&lt;h1&gt;Article Header&lt;/h1&gt;&lt;/header&gt;
                &lt;p&gt;test test test testttest test test testtest test test testtest test test testtest test test testest test test test&lt;/p&gt;
               &lt;p&gt;test test test testttest test test testtest test test testtest test test testtest test test testest test test test&lt;/p&gt;
               &lt;p&gt;test test test testttest test test testtest test test testtest test test testtest test test testest test test test&lt;/p&gt;
               &lt;footer&gt;&lt;h2&gt;Article Footer&lt;/h2&gt;&lt;/footer&gt;
            &lt;/article&gt;

            &lt;article&gt;
                &lt;header&gt;&lt;h1&gt;Article Header&lt;/h1&gt;&lt;/header&gt;
                &lt;p&gt;test test test testttest test test testtest test test testtest test test testtest test test testest test test test&lt;/p&gt;
               &lt;p&gt;test test test testttest test test testtest test test testtest test test testtest test test testest test test test&lt;/p&gt;
               &lt;p&gt;test test test testttest test test testtest test test testtest test test testtest test test testest test test test&lt;/p&gt;
               &lt;footer&gt;&lt;h2&gt;Article Footer&lt;/h2&gt;&lt;/footer&gt;
            &lt;/article&gt;
        &lt;/section&gt;

        &lt;!-相关内容--&gt;
        &lt;aside&gt;
            &lt;h3&gt;Aside&lt;/h3&gt;
            &lt;p&gt;test test test testttest test test testtest test test testtest test test testtest test test testest test test test&lt;/p&gt;
        &lt;/aside&gt;

        &lt;!--标记尾区--&gt;
        &lt;footer&gt;&lt;h2&gt;Footer&lt;/h2&gt;&lt;/footer&gt;
    &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<h3>Related Posts</h3><ul><li>0</li></ul><h3>Recent Comments</h3><ul><li><a class="commentor" href="" >皇冠网址 - www.2532777.com|2kq70i</a> : <a class="comment_content" href="http://www.weiking.com.cn/post/704.html#comment-14366" title="View the entire comment by 皇冠网址 - www.2532777.com|2kq70i" >呵呵，内容写的很到位，感觉很好，收藏一下,...壬辰年(龙)二月初一 2012-2-22</a></li>
<li><a class="commentor" href="http://www.nb-ryb.com" >维科</a> : <a class="comment_content" href="http://www.weiking.com.cn/post/704.html#comment-14364" title="View the entire comment by 维科" >希望博主能多多分享一些好的博文，持续关注中</a></li>
<li><a class="commentor" href="http://goo.gl/QBbB8" >网购分享</a> : <a class="comment_content" href="http://www.weiking.com.cn/post/704.html#comment-13697" title="View the entire comment by 网购分享" >每次来都有心的惊喜，这次也一样。网购分享，分享您的网购生活！www.5wg.net，分享新年大优惠，...</a></li>
<li><a class="commentor" href="http://iphonemee.com" >爱疯迷Myang</a> : <a class="comment_content" href="http://www.weiking.com.cn/post/704.html#comment-13642" title="View the entire comment by 爱疯迷Myang" >赶紧推广 html5 吧，mac 用户的心声。。。</a></li>
<li><a class="commentor" href="http://0" >肖箫</a> : <a class="comment_content" href="http://www.weiking.com.cn/post/704.html#comment-13627" title="View the entire comment by 肖箫" >为自己和家人精心挑选一款温暖，高雅，时尚的保暖内衣，让这个冬天不再寒冷。肖箫为您奉上天蚕内衣，这个严...</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.weiking.com.cn/post/704.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>浅析JavaScript和PHP中三个等号（===）和两个等号（==）的区别</title>
		<link>http://www.weiking.com.cn/post/696.html</link>
		<comments>http://www.weiking.com.cn/post/696.html#comments</comments>
		<pubDate>Fri, 18 Nov 2011 07:04:42 +0000</pubDate>
		<dc:creator>weiking</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[js中===与==]]></category>
		<category><![CDATA[三等号与双等号区别]]></category>

		<guid isPermaLink="false">http://www.weiking.com.cn/?p=696</guid>
		<description><![CDATA[首先，先做个简单的介绍，让先有个直观的认识

== equality 等同 === identity 恒等

== 两边值类型不同的时候，要先进行类型转换，再比较。

=== 不做类型转换，类型不同的一定不等。

举例说明：

<span class="readmore"><a href="http://www.weiking.com.cn/post/696.html" title="浅析JavaScript和PHP中三个等号（===）和两个等号（==）的区别">阅读全文——共1689字</a></span>]]></description>
			<content:encoded><![CDATA[<p>首先，先做个简单的介绍，让先有个直观的认识<br />
== equality 等同 === identity 恒等<br />
== 两边值类型不同的时候，要先进行类型转换，再比较。<br />
=== 不做类型转换，类型不同的一定不等。</p>
<p>举例说明：</p>
<p>“1&#8243; == true<br />
类型不同，”==”将先做类型转换，把true转换为1，即为 “1&#8243; == 1；<br />
此时，类型仍不同，继续进行类型转换，把”1&#8243;转换为1，即为 1 == 1；<br />
此时，”==” 左右两边的类型都为数值型，比较成功！</p>
<p>如果比较：”1&#8243; === true 左侧为字符型，右侧为bool布尔型，左右两侧类型不同，结果为false；<br />
如果比较：”1&#8243; === 1 左侧为字符型，右侧为int数值型，左右两侧类型不同，结果为false；<br />
如果比较： 1 === 1 左侧为int数值型，右侧为int数值型，左右两侧类型相同，数值大小也相同，结果为true；<br />
如果比较： 1 === 2 左侧为int数值型，右侧为int数值型，左右两侧类型相同，但数值大小不同，结果为false；</p>
<p>简而言之就是 “==” 只要求值相等; “===” 要求值和类型都相等 ^_^</p>
<p>============================================================================</p>
<p>下面，我们对”==”和”===”的区别，做一些较为深入的剖析介绍</p>
<p>先说 ===，这个比较简单，具体比较规则如下：<br />
1、如果类型不同，就[不相等]<br />
2、如果两个都是数值，并且是同一个值，那么[相等]；(！例外)的是，如果其中至少一个是NaN，那么[不相等]。（判断一个值是否是NaN，只能用isNaN()来判断）<br />
3、如果两个都是字符串，每个位置的字符都一样，那么[相等]；否则[不相等]。<br />
4、如果两个值都是true，或者都是false，那么[相等]。<br />
5、如果两个值都引用同一个对象或函数，那么[相等]；否则[不相等]。<br />
6、如果两个值都是null，或者都是undefined，那么[相等]。</p>
<p>再说 ==，具体比较规则如下：</p>
<p>1、如果两个值类型相同，进行 === 比较，比较规则同上<br />
2、如果两个值类型不同，他们可能相等。根据下面规则进行类型转换再比较：<br />
a、如果一个是null、一个是undefined，那么[相等]。<br />
b、如果一个是字符串，一个是数值，把字符串转换成数值再进行比较。<br />
c、如果任一值是 true，把它转换成 1 再比较；如果任一值是 false，把它转换成 0 再比较。<br />
d、如果一个是对象，另一个是数值或字符串，把对象转换成基础类型的值再比较。对象转换成基础类型，利用它的toString或者valueOf方法。js核心内置类，会尝试valueOf先于toString；例外的是Date，Date利用的是toString转换。非js核心的对象，令说（比较麻烦，我也不大懂）<br />
e、任何其他组合（array数组等），都[不相等]。</p>
<p>举例说明：<br />
“1&#8243; == true<br />
类型不等，true会先转换成数值 1，现在变成 “1&#8243; == 1，再把”1&#8243;转换成 1，比较 1 == 1， 相等。</p>
<p>= 赋值运算符<br />
== 等于<br />
=== 严格等于<br />
例：<br />
var a = 3;<br />
var b = “3&#8243;;</p>
<p>a==b 返回 true<br />
a===b 返回 false</p>
<p>因为a,b的类型不一样 ===用来进行严格的比较判断，结果为false</p>
<p>=============</p>
<p>var priceOfApple = “3元”; // 苹果的价格<br />
var priceOfBanana = “3.5元”; // 香蕉的价格<br />
priceOfApple = parseInt( priceOfApple ); // 解析苹果的价格<br />
var priceOfBanana2 = parseInt( priceOfBanana ); // 解析香蕉的价格<br />
if( ( priceOfApple===3 ) &amp;&amp; ( priceOfBanana2 === 3 ) // 检查解析是否成功<br />
&amp;&amp; ( parseFloat( priceOfBanana ) ===3.5 ) )<br />
{<br />
alert( “苹果的价格:” + priceOfApple // 输出水果的价格<br />
+ “/n香蕉的价格的整数部分:” + priceOfBanana2<br />
+ “/n香蕉的价格:” + parseFloat( priceOfBanana ) );<br />
}</p>
<h3>Related Posts</h3><ul><li>0</li></ul><h3>Recent Comments</h3><ul><li><a class="commentor" href="" >http://www.cctlhs.com</a> : <a class="comment_content" href="http://www.weiking.com.cn/post/696.html#comment-12986" title="View the entire comment by http://www.cctlhs.com" >这个是什么</a></li>
<li><a class="commentor" href="http://www.04560.com" >南京男科医院</a> : <a class="comment_content" href="http://www.weiking.com.cn/post/696.html#comment-11385" title="View the entire comment by 南京男科医院" >随便看看，关注一下！</a></li>
<li><a class="commentor" href="http://www.china-ky.com" >消防水枪</a> : <a class="comment_content" href="http://www.weiking.com.cn/post/696.html#comment-10598" title="View the entire comment by 消防水枪" >很详细 学习了</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.weiking.com.cn/post/696.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>jQuery(function(){})与(function(){})(jQuery)的区别</title>
		<link>http://www.weiking.com.cn/post/694.html</link>
		<comments>http://www.weiking.com.cn/post/694.html#comments</comments>
		<pubDate>Fri, 18 Nov 2011 06:44:53 +0000</pubDate>
		<dc:creator>weiking</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery基数写法]]></category>

		<guid isPermaLink="false">http://www.weiking.com.cn/?p=694</guid>
		<description><![CDATA[jQuery(function(){})与(function(){})(jQuery)的区别

开发jQuery插件时总结的一些经验分享一下。

一、先看

jQuery(function(){

   //Code

<span class="readmore"><a href="http://www.weiking.com.cn/post/694.html" title="jQuery(function(){})与(function(){})(jQuery)的区别">阅读全文——共434字</a></span>]]></description>
			<content:encoded><![CDATA[<p>jQuery(function(){})与(function(){})(jQuery)的区别</p>
<p>开发jQuery插件时总结的一些经验分享一下。<br />
一、先看</p>
<p>jQuery(function(){<br />
   //Code<br />
});</p>
<p>全写为<br />
jQuery(document).ready(function(){<br />
   //Code<br />
});</p>
<p>意义为在DOM加载完毕后执行了ready()方法。</p>
<p>二、再看<br />
(function(){<br />
   //Code<br />
})(jQuery)；<br />
其实际上是执行()(para)匿名方法,只不过是传递了jQuery对象。</p>
<p>三、总结</p>
<p>jQuery(function(){　});用于存放操作DOM对象的代码，执行其中代码时DOM对象已存在。不可用于存放开发插件的代码，因为jQuery对象没有得到传递，外部通过jQuery.method也调用不了其中的方法（函数）。<br />
(function(){　})(jQuery)；用于存放开发插件的代码，执行其中代码时DOM不一定存在，所以直接自动执行DOM操作的代码请小心使用。 </p>
<h3>Related Posts</h3><ul><li>0</li></ul><h3>Recent Comments</h3><ul></ul>]]></content:encoded>
			<wfw:commentRss>http://www.weiking.com.cn/post/694.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript如何解析array与object</title>
		<link>http://www.weiking.com.cn/post/586.html</link>
		<comments>http://www.weiking.com.cn/post/586.html#comments</comments>
		<pubDate>Sat, 12 Nov 2011 10:35:49 +0000</pubDate>
		<dc:creator>weiking</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[js处理json]]></category>
		<category><![CDATA[js处理数组]]></category>

		<guid isPermaLink="false">http://www.weiking.com.cn/?p=586</guid>
		<description><![CDATA[与服务器端交互过程中，经常让我们前端来处理服务端传过来的json，用几个小demo来说明一下：

1.javascript处理array数组



   //解析数组Arrays格式

	var obj = &#91;&#91;&#34;user&#34;, &#34;name&#34;, &#34;id&#34;&#93;,&#91;&#34;buy&#34;, &#34;classname&#34;&#93;&#93;;

<span class="readmore"><a href="http://www.weiking.com.cn/post/586.html" title="Javascript如何解析array与object">阅读全文——共350字</a></span>]]></description>
			<content:encoded><![CDATA[<p>与服务器端交互过程中，经常让我们前端来处理服务端传过来的json，用几个小demo来说明一下：</p>
<p><strong>1.javascript处理array数组</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">   <span style="color: #006600; font-style: italic;">//解析数组Arrays格式</span>
	<span style="color: #003366; font-weight: bold;">var</span> obj <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;user&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;buy&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;classname&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>obj<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>2.javasript处理json</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">   <span style="color: #003366; font-weight: bold;">var</span> objs <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;[{id:100, name:'wangwei_1'}, { id:221, name:'wangwei_2'}]&quot;</span><span style="color: #339933;">;</span><span style="color: #006600; font-style: italic;">//服务器传回来一般都是字符串形式</span>
   objs <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">eval</span><span style="color: #009900;">&#40;</span>objs<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//必须用eval来处理以下</span>
   <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>objs<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span>.<span style="color: #000066;">name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>3.eval方法的作用</strong><br />
eval把服务端传过来的字符串处理为我们本地可以直接操作的对象(obj.xx)的格式</p>
<h3>Related Posts</h3><ul><li>0</li></ul><h3>Recent Comments</h3><ul><li><a class="commentor" href="" >mactv</a> : <a class="comment_content" href="http://www.weiking.com.cn/post/586.html#comment-9512" title="View the entire comment by mactv" >iframe引用网页的流量属于原网站,但iframe的父框架流量来自本网站,我这么理解的

我的...</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.weiking.com.cn/post/586.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>什么人适合做前端工程师？</title>
		<link>http://www.weiking.com.cn/post/680.html</link>
		<comments>http://www.weiking.com.cn/post/680.html#comments</comments>
		<pubDate>Wed, 02 Nov 2011 10:22:20 +0000</pubDate>
		<dc:creator>weiking</dc:creator>
				<category><![CDATA[个人]]></category>
		<category><![CDATA[前端工程师类型]]></category>
		<category><![CDATA[前端的成长轨迹]]></category>

		<guid isPermaLink="false">http://www.weiking.com.cn/?p=680</guid>
		<description><![CDATA[随着互联网的迅猛发展和普及，一个新型的行业和新兴的职位正在上升到技术的层面：web前端开发工程师。一些想从事、或感兴趣的人会问：我适合做前端工程师吗？什么样的人最合适？

首先，我们看一下前端新人从哪里来？相对于其他IT技术职位来说，Web前端工程师算是半个程序员，很多从事此项工作的都是非计算机相关专业出身， 这当然是因为互联网行业吸引人以及HTML和CSS入门起点低，目前大学里尚能全民考C（计算机二级），全民做网页也没有什么稀奇，而且因为职位所处位置 的交叉性，注定有很多Web前端开发人员是转行而来。

1）设计师转前端

这种情况最常见，究其原因与web标准在中国的推广手法有关，我们最先接触的是“禅意花园”那些漂亮的设计，另一方面中国的网页设计师通常要兼顾页 面制作，所以自然也会对其样式和数据分离的特性产生兴趣。搞设计出身的前端有一个优势是能更好地把握设计稿的表现重点，对于某些视觉设计师不合规范的操作 能轻松地化解，劣势也很明显，缺乏数理基础，写出的代码不够严谨，JavaScript基础也普遍较差，后期需要学习加强。



<span class="readmore"><a href="http://www.weiking.com.cn/post/680.html" title="什么人适合做前端工程师？">阅读全文——共1372字</a></span>]]></description>
			<content:encoded><![CDATA[<p>随着互联网的迅猛发展和普及，一个新型的行业和新兴的职位正在上升到技术的层面：web前端开发工程师。一些想从事、或感兴趣的人会问：我适合做前端工程师吗？什么样的人最合适？</p>
<p>首先，我们看一下前端新人从哪里来？相对于其他IT技术职位来说，Web前端工程师算是半个程序员，很多从事此项工作的都是非计算机相关专业出身， 这当然是因为互联网行业吸引人以及HTML和CSS入门起点低，目前大学里尚能全民考C（计算机二级），全民做网页也没有什么稀奇，而且因为职位所处位置 的交叉性，注定有很多Web前端开发人员是转行而来。</p>
<p><strong>1）设计师转前端</strong></p>
<p>这种情况最常见，究其原因与web标准在中国的推广手法有关，我们最先接触的是“禅意花园”那些漂亮的设计，另一方面中国的网页设计师通常要兼顾页 面制作，所以自然也会对其样式和数据分离的特性产生兴趣。搞设计出身的前端有一个优势是能更好地把握设计稿的表现重点，对于某些视觉设计师不合规范的操作 能轻松地化解，劣势也很明显，缺乏数理基础，写出的代码不够严谨，JavaScript基础也普遍较差，后期需要学习加强。</p>
<div style="text-align: center;">
<dl id="attachment_3903">
<dt><a href="http://blog.jobbole.com/wp-content/uploads/2011/10/new-comer-of-web-front-end.jpg"><img title="Web前端开发新人来源 1" src="http://blog.jobbole.com/wp-content/uploads/2011/10/new-comer-of-web-front-end.jpg" alt="new comer of web front end 什么人适合做前端工程师？" width="528" height="184" /></a></dt>
<dd>Web前端开发新人来源 3</dd>
</dl>
</div>
<p><strong>2）后台程序员转前端</strong></p>
<p>作为与代码有关的工作，更适合程序员学习，其思维方式相似。像淘宝第一位前端工程师本身是写Java的，经常也听到有面试后台程序员结果被推到前端 然后被录取的，很多后台转战前端的程序员，大多去做Web Apps，即基于Ajax和各种复杂架构的Web运用，而这一技术方向，也是Web前端的大势所趋。</p>
<p><strong>3）网虫转前端</strong></p>
<p>随着互联网的普及，越来越多的小孩很早便接触了互联网，玩游戏、做博客等等，想学点与互联网相关的内容，首选自然是前端，因为入门要求低，很多Twitter名人就是其中的典型，他们更懂得网民需要什么，写的程序操作简单。</p>
<p><strong>4）策划、编辑、草根站长转前端</strong></p>
<p>很多的网站策划和编辑不再只是复制和转帖这类重复性的工作，也需要看懂常见的代码，对于提高工作效率和质量有一定的帮助，慢慢的也开始了解这个行 业，比一般性的文字工作有趣，并且经过深入的学习，如Javascript、Ajax等技术，其就业领域发生了极大的变化；还有很多在实践中成长起来的草 根站长，最初就是搞几个站玩玩，在不断的建站过程中学到一些前端技术，提高了“前端修养”，开始是为了养家糊口，慢慢也变成了自己的一项事业。</p>
<p><strong>总结</strong></p>
<p>通过以上分析可以发现，从事web前端行业的人形形色色，或者是迫于工作需要，或者是感兴趣，但对于我们即将从事这个行业来说，首先是对于这个行业 的兴趣，只有有兴趣才能更深入的学习，克服在学习过程中的枯燥和困难；如果能有可以加分的优势更好，如目前所从事的行业与其相关，或大学学的专业相关，这 些都没有也没有关系，只要有兴趣和不懈的激情，也可以通过后天的努力，走上前端开发的职业道路。及时目前我们所从事的与前端一点关系也没有，但随着工作的 深入，自身能力的提高，兴趣点发生转移也不是不可能。</p>
<p>互联网瞬息万变，前端行业发展喜人，Web 2.0网站风光无限，同时也给从业者提出很多新的要求。而你跟随时代的脚步有多紧，很大程度上决定了你将来会有多成功。目前互联网前所未有地渗入移动设 备，因此可以看出手机等移动设备上的开发潜力是非常大的，淘宝已经新成立了无限事业部，联通的“iPhone拥有各种应用程序”广告铺天盖地地袭来，你还 在等什么呢？</p>
<p>原文：<a href="http://blog.jobbole.com/3845/" target="_blank">伯乐在线</a></p>
<h3>Related Posts</h3><ul><li>0</li></ul><h3>Recent Comments</h3><ul><li><a class="commentor" href="http://fuxuanji.236w.com" >浮选机</a> : <a class="comment_content" href="http://www.weiking.com.cn/post/680.html#comment-8518" title="View the entire comment by 浮选机" >每个人都会找到适合自己的位置的</a></li>
<li><a class="commentor" href="http://www.fb.mu" >fbmu</a> : <a class="comment_content" href="http://www.weiking.com.cn/post/680.html#comment-5629" title="View the entire comment by fbmu" >所言即是，前端入行容易</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.weiking.com.cn/post/680.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>序列化提取表单值： serialize()用法</title>
		<link>http://www.weiking.com.cn/post/675.html</link>
		<comments>http://www.weiking.com.cn/post/675.html#comments</comments>
		<pubDate>Wed, 02 Nov 2011 09:05:41 +0000</pubDate>
		<dc:creator>weiking</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[serialize()用法]]></category>

		<guid isPermaLink="false">http://www.weiking.com.cn/?p=675</guid>
		<description><![CDATA[今天去python后台ajax方式提交时候，发现我们有个动态表单（随着用户的添加自动增加表单），这样情况下，我们就不能用传统的手动固定data：&#8217;name=abc&#38;sex=1&#8242;这种形式来请求，必须把所有表单的值都全部自动提取出来，这样情况下，serialize()隆重登场（之前傻逼没用到过，还是其他哥们提示的，恨自己！！）。

jquery中serialize()用法：序列化表单值



&#60;html&#62;

&#60;head&#62;  

<span class="readmore"><a href="http://www.weiking.com.cn/post/675.html" title="序列化提取表单值： serialize()用法">阅读全文——共386字</a></span>]]></description>
			<content:encoded><![CDATA[<p>今天去python后台ajax方式提交时候，发现我们有个动态表单（随着用户的添加自动增加表单），这样情况下，我们就不能用传统的手动固定data：&#8217;name=abc&amp;sex=1&#8242;这种形式来请求，必须把所有表单的值都全部自动提取出来，这样情况下，serialize()隆重登场（之前傻逼没用到过，还是其他哥们提示的，恨自己！！）。</p>
<p><strong>jquery中serialize()用法：序列化表单值</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>  
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://code.jquery.com/jquery-1.7rc2.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
    $(document).ready(function(){
      $(&quot;button&quot;).click(function(){
        $(&quot;div&quot;).text($(&quot;form&quot;).serialize());
      });
    });
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span> <span style="color: #000066;">action</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span>&gt;</span>
First name: <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;FirstName&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Bill&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span>
Last name: <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;LastName&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Gates&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span>
select: <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">select</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sel&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">option</span>&gt;</span>ppp<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">checked</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;checked&quot;</span>&gt;</span>aaa<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">select</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;radio&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;radio&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;radio1&quot;</span> <span style="color: #000066;">checked</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;checked&quot;</span><span style="color: #66cc66;">/</span>&gt;</span> 单选
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">button</span>&gt;</span>序列化表单值<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">button</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></div></div>

<p>返回结果：<span style="color: #ff0000;"><strong>FirstName=Bill&amp;LastName=Gates&amp;sel=ppp&amp;radio=radio1</strong></span></p>
<h3>Related Posts</h3><ul><li>0</li></ul><h3>Recent Comments</h3><ul></ul>]]></content:encoded>
			<wfw:commentRss>http://www.weiking.com.cn/post/675.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript中有关时间的获取</title>
		<link>http://www.weiking.com.cn/post/673.html</link>
		<comments>http://www.weiking.com.cn/post/673.html#comments</comments>
		<pubDate>Wed, 02 Nov 2011 05:31:09 +0000</pubDate>
		<dc:creator>weiking</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Date()]]></category>
		<category><![CDATA[Javascript中有关时间的获取]]></category>

		<guid isPermaLink="false">http://www.weiking.com.cn/?p=673</guid>
		<description><![CDATA[Javascript中有关时间的获取，整理了下：



&#60;script type=&#34;text/javascript&#34; language=&#34;JavaScript&#34;&#62;// &#60;![CDATA[

var myDate = new Date&#40;&#41;;

myDate.getYear&#40;&#41;;       //获取当前年份(2位)

<span class="readmore"><a href="http://www.weiking.com.cn/post/673.html" title="Javascript中有关时间的获取">阅读全文——共26字</a></span>]]></description>
			<content:encoded><![CDATA[<p>Javascript中有关时间的获取，整理了下：</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span><span style="color: #339933;">&gt;</span><span style="color: #006600; font-style: italic;">// &lt;![CDATA[</span>
<span style="color: #003366; font-weight: bold;">var</span> myDate <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
myDate.<span style="color: #660066;">getYear</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>       <span style="color: #006600; font-style: italic;">//获取当前年份(2位)</span>
myDate.<span style="color: #660066;">getFullYear</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #006600; font-style: italic;">//获取完整的年份(4位,1970-????)</span>
myDate.<span style="color: #660066;">getMonth</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>      <span style="color: #006600; font-style: italic;">//获取当前月份(0-11,0代表1月)</span>
myDate.<span style="color: #660066;">getDate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>       <span style="color: #006600; font-style: italic;">//获取当前日(1-31)</span>
myDate.<span style="color: #660066;">getDay</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>        <span style="color: #006600; font-style: italic;">//获取当前星期X(0-6,0代表星期天)</span>
myDate.<span style="color: #660066;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>       <span style="color: #006600; font-style: italic;">//获取当前时间(从1970.1.1开始的毫秒数)</span>
myDate.<span style="color: #660066;">getHours</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>      <span style="color: #006600; font-style: italic;">//获取当前小时数(0-23)</span>
myDate.<span style="color: #660066;">getMinutes</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    <span style="color: #006600; font-style: italic;">//获取当前分钟数(0-59)</span>
myDate.<span style="color: #660066;">getSeconds</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    <span style="color: #006600; font-style: italic;">//获取当前秒数(0-59)</span>
myDate.<span style="color: #660066;">getMilliseconds</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #006600; font-style: italic;">//获取当前毫秒数(0-999)</span>
myDate.<span style="color: #660066;">toLocaleDateString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    <span style="color: #006600; font-style: italic;">//获取当前日期</span>
<span style="color: #003366; font-weight: bold;">var</span> mytime<span style="color: #339933;">=</span>myDate.<span style="color: #660066;">toLocaleTimeString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    <span style="color: #006600; font-style: italic;">//获取当前时间</span>
myDate.<span style="color: #660066;">toLocaleString</span><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>       <span style="color: #006600; font-style: italic;">//获取日期与时间</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>mytime<span style="color: #339933;">&lt;</span><span style="color: #3366CC;">&quot;23:30:00&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
   <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>mytime<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #006600; font-style: italic;">// ]]&gt;&lt;/script&gt;</span></pre></div></div>

<p>&nbsp;</p>
<h3>Related Posts</h3><ul><li>0</li></ul><h3>Recent Comments</h3><ul><li><a class="commentor" href="http://www.weiking.com.cn" >weiking</a> : <a class="comment_content" href="http://www.weiking.com.cn/post/673.html#comment-10043" title="View the entire comment by weiking" >可以啊</a></li>
<li><a class="commentor" href="http://www.99welt.com" >野狼博客</a> : <a class="comment_content" href="http://www.weiking.com.cn/post/673.html#comment-9731" title="View the entire comment by 野狼博客" >博主也是做开发的吗？一直想找一个技术类的网站做链接，不错啊，以后常来，可以交换链接吗？</a></li>
<li><a class="commentor" href="http://www.pp17.com" >长春网站设计</a> : <a class="comment_content" href="http://www.weiking.com.cn/post/673.html#comment-9543" title="View the entire comment by 长春网站设计" >很好的代码，使用方法</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.weiking.com.cn/post/673.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>onmousemove与onmouseover，onmouseup与onmoseclick那点事</title>
		<link>http://www.weiking.com.cn/post/671.html</link>
		<comments>http://www.weiking.com.cn/post/671.html#comments</comments>
		<pubDate>Sun, 30 Oct 2011 09:34:48 +0000</pubDate>
		<dc:creator>weiking</dc:creator>
				<category><![CDATA[html]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[onmousemove与onmouseover的区别]]></category>
		<category><![CDATA[onmouseup与onmoseclick区别]]></category>

		<guid isPermaLink="false">http://www.weiking.com.cn/?p=671</guid>
		<description><![CDATA[一：onmousemove与onmouseover的区别

时间上 onmousemove 事件触发后，再触发 onmouseover 事件。

按钮上 不区分鼠标按钮。

动作上 onmouseover 只在刚进入区域时触发。 onmousemove 除了刚进入区域触发外，在区域内移动鼠标，也会触发该事件。

当鼠标移动很快时，可能不会触发这两个事件

<span class="readmore"><a href="http://www.weiking.com.cn/post/671.html" title="onmousemove与onmouseover，onmouseup与onmoseclick那点事">阅读全文——共453字</a></span>]]></description>
			<content:encoded><![CDATA[<p>一：onmousemove与onmouseover的区别</p>
<p>时间上 <strong>onmousemove</strong> 事件触发后，再触发 <strong>onmouseover</strong> 事件。</p>
<p>按钮上 不区分鼠标按钮。</p>
<p>动作上 <strong>onmouseover</strong> 只在刚进入区域时触发。 <strong>onmousemove</strong> 除了刚进入区域触发外，在区域内移动鼠标，也会触发该事件。</p>
<p>当鼠标移动很快时，可能不会触发这两个事件</p>
<p>二：onmouseup与onmoseclick区别</p>
<p>时间上 <strong>onmouseup</strong> 事件触发后，再触发 <strong>onclick</strong> 事件。</p>
<p>按钮上 <strong>onmouseup</strong> 检测鼠标任意键（包含滚轮），<strong>onclick</strong>只有在鼠标左键时触发。</p>
<p>动作上 <strong>onmouseup</strong> 侧重于检测鼠标弹起，而 <strong>onclick</strong> 检测鼠标按下并弹起。在文档任意区域按下鼠标，甚至用 Alt+Tab 切换任务，再 Alt+Tab 切换回来，再将指针移到控件上，放开鼠标，仍可触发 <strong>onmouseup</strong> 事件；而 <strong>onclick</strong> 必须在同一元素上按下并释放（在鼠标按下与释放之间切换任务时，IE 不再承认 onclick，NS 则仍承认）。</p>
<h3>Related Posts</h3><ul><li>0</li></ul><h3>Recent Comments</h3><ul></ul>]]></content:encoded>
			<wfw:commentRss>http://www.weiking.com.cn/post/671.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>html邮件edm模板设计中应该注意的问题</title>
		<link>http://www.weiking.com.cn/post/667.html</link>
		<comments>http://www.weiking.com.cn/post/667.html#comments</comments>
		<pubDate>Mon, 24 Oct 2011 06:32:44 +0000</pubDate>
		<dc:creator>weiking</dc:creator>
				<category><![CDATA[html]]></category>
		<category><![CDATA[Edm设计规则]]></category>

		<guid isPermaLink="false">http://www.weiking.com.cn/?p=667</guid>
		<description><![CDATA[这些天战争项目组Facebook平台中用到Email邮件发送，我们之前用的是自己的邮件系统，但是被当作垃圾邮件几率很高，由于Facebook平台也有自己邮件接口，所以我这次就尝试用Facebook自己的notifications.sendEmail接口来处理。

Facebook发送邮件接口：notifications.sendEmail



FB.api&#40;

  &#123;

<span class="readmore"><a href="http://www.weiking.com.cn/post/667.html" title="html邮件edm模板设计中应该注意的问题">阅读全文——共2640字</a></span>]]></description>
			<content:encoded><![CDATA[<p>这些天战争项目组Facebook平台中用到Email邮件发送，我们之前用的是自己的邮件系统，但是被当作垃圾邮件几率很高，由于Facebook平台也有自己邮件接口，所以我这次就尝试用Facebook自己的notifications.sendEmail接口来处理。</p>
<p><strong>Facebook发送邮件接口：notifications.sendEmail</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">FB.<span style="color: #660066;">api</span><span style="color: #009900;">&#40;</span>
  <span style="color: #009900;">&#123;</span>
    method<span style="color: #339933;">:</span> <span style="color: #3366CC;">'notifications.sendEmail'</span><span style="color: #339933;">,</span>
    recipients<span style="color: #339933;">:</span> userId<span style="color: #339933;">,</span><span style="color: #006600; font-style: italic;">//接收人Id，多人id，用“，”分开</span>
    subject<span style="color: #339933;">:</span> subject<span style="color: #339933;">,</span>
    text<span style="color: #339933;">:</span> text<span style="color: #339933;">,</span><span style="color: #006600; font-style: italic;">//純文本郵件發送方式</span>
    fbml<span style="color: #339933;">:</span> fbml<span style="color: #339933;">,</span><span style="color: #006600; font-style: italic;">//MIME郵件發送方式，如果與text方式發送，優先等級提高</span>
    callback<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>response<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #006600; font-style: italic;">//延迟返回值</span>
      <span style="color: #006600; font-style: italic;">//alert(&quot;success&quot;);</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>PS：MIME邮件方式，参考<a href="http://zh.wikipedia.org/wiki/MIME" target="_blank">维基百科</a></p>
<h4><strong>Html模板中注意的问题：</strong></h4>
<p>1、全局规则之一，不要写&lt;style&gt;标签、不要写class，所有CSS都用style属性，什么元素需要什么样式就用style写内联的CSS。</p>
<p>2，全局规则之二，不要写&lt;script&gt;标签，邮件系统全部屏蔽所有js，jeuery等js框架也包括在内，id命名默认加上其他字符。</p>
<p>3、全局规则之三，少用图片，邮箱不会过滤你的img标签，但是系统往往会默认不载入陌生来信的图片，如果用了很多图片的邮件，在片没有载入的情况下，丑陋无比甚至看不清内容，没耐心的用户直接就删除了。图片上务必加上alt。<br />
4、不要在style里面写float、position这些style，因为会被过滤。那么如何实现左右布局或者更复杂的布局呢？用table，不要嫌弃标签太烦太多。<br />
5、 style内容里面background可以设置color，但是img会被过滤，就是说不能通过CSS来设置背景图片了。但是有一个很有意思的元素属 性，也叫background，里面可以定义一个图片路径，这是个不错的替代方案，虽然这样功能有限，比如无法定位背景图片了，有总比没有好。例如要给一 个单元格加一个背景，必须这样写：<br />
&lt;td background=”http://image1.koubei.com/images/common/logo_koubei.gif”&gt;&lt;/td&gt;<br />
6、div模式的邮箱不支持flash，iframe模式的有待验证。最后提一句，sohu的邮箱很怪异，会在每个文本段后面加一个空格，导致原本正常的排版一行放不下而换行，从而使某些布局错乱。所以，如果你要兼容sohu邮箱的话，遇到一些紧凑的布局就要格外小心了，尽量减少文本段的数量，留足宽度。</p>
<h4><strong>邮件模板设计的规则：</strong></h4>
<p>1.!Doctype声明 ：为了向前兼容和避免某些浏览器的怪癖，使用html5的!doctype声明，格式如下： &lt;!DOCTYPE HTML&gt;</p>
<p>2. 宁可冗余，也不可缺少必要定义。</p>
<p>3. 充分利用表格的私有属性来布局。width, height, bgcolor, background, align, valign等</p>
<p>4. 可替代性：在编写html的时候，请思考当你页面的所有图片都被屏蔽时，是否用户还能了解页面的主要内容。请务必在所有要设置背景图片的元素上，定义背景颜色。</p>
<p>5. 可利用Dreamweaver等工具来协助编写html，但切记，一定要时候做好每行代码的检查。</p>
<p><strong>样式：</strong></p>
<p>1. 文字的处理：font-* 族的CSS属性不允许使用缩写，请分别定义 font-size, font-weight, line-height, font-family(font-family有可能被过滤)</p>
<p>2. 继承性：注意表格不会继承外部的font等属性，请务必，在每个&lt;td&gt;元素上都定义字体属性和颜色。</p>
<p>3. 背景的处理：不 允许使用style=”background:url(http://…)”，请使用&lt;td&gt;的属性(attribute) background=“http://…”。（由于CSS背景图片是一种会影响页面渲染速度的定义，因此大多数Web邮件系统会过滤它。）</p>
<p>背景颜色，也请使用表格的bgcolor属性。</p>
<p>4. 对于复杂样式的处理，可以大胆地、大块地切图。</p>
<p>5. 避免尝试让两个table-cell的元素对齐，如果, 一个元素是用具体的宽度定义（width=”100″），另一个元素是用百分比来定位( width=”50%”)</p>
<p>6. 避免使用list-style来处理列表样式，请使用 “ &amp;#8226; ” 字符来替代。</p>
<p>7. 避免使用&lt;img&gt;元素拼接的方式，来实现背景大图的分割，尽量使用表格的background，我们知道，在&lt;img&gt;元素下4px空白的问题。</p>
<h4><strong>禁用的，和不建议使用的CSS样式：</strong></h4>
<p>这些样式，大都是可能引起元素偏移到容器外的样式</p>
<p>禁止使用 position, background, float</p>
<h4><strong>特别说明：</strong></h4>
<p>margin: margin的使用要非常谨慎，不允许使用margin作为重要的布局依据，不允许使用负margin，避免使用非零和非auto的margin属性。</p>
<h4><strong>图片版本控制：</strong></h4>
<p>如果邮件模板中的图片，使用 CDN 网络地址——如 http://i3.dpfile.com/…/abc.png——那么，更新这张图片的时候，请联系DBA（数据库工程师）刷新该图片的版本号。</p>
<p>并且，在新的邮件模板中，将该图片的版本号加1，比如：</p>
<p>将 http://i1.dpfile.com/…/edm/top.png 更新为 http://i1.dpfile.com/…/edm/top.v1.png</p>
<p>将 http://i1.dpfile.com/…/edm/bot.v12.png 更新为 http://i1.dpfile.com/…/edm/top.v13.png</p>
<p><strong>常见问题：</strong></p>
<p>1. 如何让邮件在Gmail等Web页面中居中，有几种方式：</p>
<p>a&gt; 在 body上定义style=”width:apx; margin:auto”。注意，在Web邮件中，会自动为你生成一个&lt;div style=”width:apx; margin:auto”&gt; 的元素在最外层。(可以有效利用这一特性，定义背景颜色等样式，和实现其他可能的事情)，而不要尝试自己在邮件模板最外层添加一个带有margin:auto的&lt;div&gt;元素。</p>
<p>b&gt; 使用&lt;center&gt;</p>
<p>2. 如何在邮件的布局中占据空白</p>
<p>请使用空白的&lt;td&gt;元素，设置height属性来起到站位的作用。</p>
<h3>Related Posts</h3><ul><li>0</li></ul><h3>Recent Comments</h3><ul></ul>]]></content:encoded>
			<wfw:commentRss>http://www.weiking.com.cn/post/667.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Js的Url中传递中文参数乱码，如何获取Url中参数问题</title>
		<link>http://www.weiking.com.cn/post/654.html</link>
		<comments>http://www.weiking.com.cn/post/654.html#comments</comments>
		<pubDate>Wed, 12 Oct 2011 10:35:24 +0000</pubDate>
		<dc:creator>weiking</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[decodeURI]]></category>
		<category><![CDATA[Js的Url中传递中文参数乱码问题]]></category>
		<category><![CDATA[unescape]]></category>
		<category><![CDATA[如何获取url中的参数]]></category>

		<guid isPermaLink="false">http://www.weiking.com.cn/?p=654</guid>
		<description><![CDATA[一：Js的Url中传递中文参数乱码问题，重点：encodeURI编码，decodeURI解码：

1.传参页面 test01.html

Javascript代码：



&#60;script type=&#34;text/javascript&#34;&#62;// &#60;![CDATA[

<span class="readmore"><a href="http://www.weiking.com.cn/post/654.html" title="Js的Url中传递中文参数乱码，如何获取Url中参数问题">阅读全文——共737字</a></span>]]></description>
			<content:encoded><![CDATA[<p>一：<strong>Js的Url中传递中文参数乱码问题，重点：encodeURI编码，decodeURI解码：</strong></p>
<p>1.传参页面 test01.html<br />
Javascript代码：</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span><span style="color: #006600; font-style: italic;">// &lt;![CDATA[</span>
<span style="color: #003366; font-weight: bold;">function</span> send<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 	
 <span style="color: #003366; font-weight: bold;">var</span> url <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;test01.html&quot;</span><span style="color: #339933;">;</span>
 <span style="color: #003366; font-weight: bold;">var</span> userName <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#userName&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">encodeURI</span><span style="color: #009900;">&#40;</span>url <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;?userName=&quot;</span> <span style="color: #339933;">+</span> userName<span style="color: #009900;">&#41;</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;">// ]]&gt;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>Html代码：</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript:send()&quot;</span>&gt;</span>测试按钮<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span></pre></div></div>

<p>2. 接收参数页面：test02.html</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
 var urlinfo = window.location.href;//獲取url
 var userName = urlinfo.split(&quot;?&quot;)[1].split(&quot;=&quot;)[1];//拆分url得到&quot;=”後面的參數
 $(&quot;#userName&quot;).html(decodeURI(userName));
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></div></div>

<p><strong>二：如何获取Url“？”后，“=”的参数值：</strong></p>
<p>  A.首先用window.location.href获取到全部url值。<br />
  B.用split截取“?”后的全部<br />
  C.split(“?”)后面的[1]内数字，默认从0开始计算</p>
<p><strong>三：Js中escape，unescape，encodeURI，encodeURIComponent区别：</strong></p>
<p>1.传递参数时候使用，encodeURIComponent否则url中很容易被”#”，”？”，”&#038;”等敏感符号隔断。<br />
2.url跳转时候使用，编码用encodeURI，解码用decodeURI。<br />
3.escape() 只是为0-255以外 ASCII字符 做转换工作，转换成的 %u**** 这样的码，如果要用更多的字符如 UTF-8字符库 就一定要用 encodeURIComponent() 或 encodeURI() 转换才可以成 %nn%nn 这的码才可以,其它情况下escape，encodeURI，encodeURIComponent编码结果相同,所以为了全球的统一化进程，在用 encodeURIComponent() 或 encodeURI() 代替 escape() 使用吧！</p>
<h3>Related Posts</h3><ul><li>0</li></ul><h3>Recent Comments</h3><ul><li><a class="commentor" href="http://www.weiking.com.cn" >weiking</a> : <a class="comment_content" href="http://www.weiking.com.cn/post/654.html#comment-5275" title="View the entire comment by weiking" >呵呵，那就好！期待你下次升级。</a></li>
<li><a class="commentor" href="" >MacTv</a> : <a class="comment_content" href="http://www.weiking.com.cn/post/654.html#comment-4853" title="View the entire comment by MacTv" >终于搞明白你说的问题了，造成菜单无法隐藏的原因可能是lion的flash player兼容性可能还不...</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.weiking.com.cn/post/654.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

