<?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>标点符 &#187; JavaScript</title>
	<atom:link href="http://www.biaodianfu.com/category/web-design/designer-developer-frontend/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://www.biaodianfu.com</link>
	<description>编译自己的互联网生活</description>
	<lastBuildDate>Wed, 08 Feb 2012 08:42:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Javascript模板引擎分享</title>
		<link>http://www.biaodianfu.com/simple-javascript-templating.html</link>
		<comments>http://www.biaodianfu.com/simple-javascript-templating.html#comments</comments>
		<pubDate>Fri, 04 Nov 2011 05:26:21 +0000</pubDate>
		<dc:creator>标点符</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[模板引擎]]></category>

		<guid isPermaLink="false">http://www.biaodianfu.com/?p=4458</guid>
		<description><![CDATA[模板引擎的主要功能就是把变化的数据融入到不变的模板中，并生成最终结果。目前，前端的主要数据格式无非是XML和JSON。如何将这些数据更加方便的呈现呢？ 最近看了很多的PHP模板引擎，今天看到了一个非常棒的Javascript模板引擎，用以更方便的呈现前台数据。它的一个超级简单的、快速的，高速缓存的，非常容易使用的模板引擎。 下面就来看下这个模板引擎是如何工作的。 // Simple JavaScript Templating // John Resig - http://ejohn.org/ - MIT Licensed (function(){   var cache = {};   this.tmpl = function tmpl(str, data){     // 判断出我们是否获取一个模板或是否我们要加载一个模板并确定要缓存结果     //Figure out if we're getting a template, or if we need to load the template - and be sure to cache the result.     [...]]]></description>
			<content:encoded><![CDATA[<p>模板引擎的主要功能就是把变化的数据融入到不变的模板中，并生成最终结果。目前，前端的主要数据格式无非是XML和JSON。如何将这些数据更加方便的呈现呢？</p>
<p>最近看了很多的PHP模板引擎，今天看到了一个非常棒的Javascript模板引擎，用以更方便的呈现前台数据。它的一个超级简单的、快速的，高速缓存的，非常容易使用的模板引擎。</p>
<p>下面就来看下这个模板引擎是如何工作的。</p>
<pre class="brush: javascript; gutter: true">// Simple JavaScript Templating
// John Resig - http://ejohn.org/ - MIT Licensed
(function(){
  var cache = {};

  this.tmpl = function tmpl(str, data){
    // 判断出我们是否获取一个模板或是否我们要加载一个模板并确定要缓存结果
    //Figure out if we're getting a template, or if we need to load the template - and be sure to cache the result.

    var fn = !/\W/.test(str) ?
      cache[str] = cache[str] ||
        tmpl(document.getElementById(str).innerHTML) :

      // 生成一个可作为模板的可重复使用的函数
      // 生成器 （将会被缓存）
      new Function("obj",
        "var p=[],print=function(){p.push.apply(p,arguments);};" +

        // 使用with(){} 作为局部变量引入数据
        "with(obj){p.push('" +

        // 将模板内容转化成JavaScript
        Convert the template into pure JavaScript
        str
          .replace(/[\r\t\n]/g, " ")
          .split("&lt;%").join("\t")
          .replace(/((^|%&gt;)[^\t]*)'/g, "$1\r")
          .replace(/\t=(.*?)%&gt;/g, "',$1,'")
          .split("\t").join("');")
          .split("%&gt;").join("p.push('")
          .split("\r").join("\\'")
      + "');}return p.join('');");

    // 提供一个基础的currying给用户
    return data ? fn( data ) : fn;
  };
})();</pre>
<p>Currying 的意思为将原来的函数只可带一个参数列表以多个参数列表（注意不是多个参数）实现，如：def foo(x)(y)(z){}。</p>
<p>上面的只是具体实现的JS库，那到底怎么使用呢？</p>
<pre class="brush: javascript; gutter: true">&lt;script type="text/html" id="item_tmpl"&gt;
  &lt;div id="&lt;%=id%&gt;" even" : "")%&gt;"&gt;
    &lt;div&gt;
      &lt;img src="&lt;%=profile_image_url%&gt;"/&gt;
    &lt;/div&gt;
    &lt;div&gt;
      &lt;p&gt;&lt;b&gt;&lt;a href="/&lt;%=from_user%&gt;"&gt;&lt;%=from_user%&gt;&lt;/a&gt;:&lt;/b&gt; &lt;%=text%&gt;&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/script&gt;</pre>
<p>或是这样</p>
<pre class="brush: javascript; gutter: true">&lt;script type="text/html" id="user_tmpl"&gt;
  &lt;% for ( var i = 0; i &lt; users.length; i++ ) { %&gt;
    &lt;li&gt;&lt;a href="&lt;%=users[i].url%&gt;"&gt;&lt;%=users[i].name%&gt;&lt;/a&gt;&lt;/li&gt;
  &lt;% } %&gt;
&lt;/script&gt;</pre>
<p>上面的使用代码中出现了一个特别的script内容类型text/html，这样的类型浏览器就不要去执行其中的内容，用户也就看不到其中的内容。这样就可以非常简单的把你想要的内容模板嵌入到你的页面中。这是一种快速的曲线救国的策略。</p>
<p>讲了这么多，那么怎么把数据给模板引擎呢，这还需使用Javascript来实现：</p>
<pre class="brush: javascript; gutter: true">var results = document.getElementById("results");
results.innerHTML = tmpl("item_tmpl", dataObject);</pre>
<p>同样的你可以预先编译好需要呈现的代码供后面的使用，如下面的循环：</p>
<pre class="brush: javascript; gutter: true">var show_user = tmpl("item_tmpl"), html = "";
for ( var i = 0; i &lt; users.length; i++ ) {
  html += show_user( users[i] );</pre>
<p>以上就是全部代码，整个逻辑非常的清晰，就是把模板语言“编译”为Javascript的原生语法。这个引擎的优点在于：</p>
<ol>
<li>可以使用任何Javascript支持的语法。</li>
<li>Parse模板的过程在闭包内执行，不会产生全局变量。</li>
<li>对“编译”后的模板进行了缓存，下次可以跳过“编译”的过程直接使用。</li>
</ol>
<p>最后大家还是要试一下才知道好不好用。</p>
<p>原代码地址：<a href="http://ejohn.org/blog/javascript-micro-templating/">http://ejohn.org/blog/javascript-micro-templating/</a></p>
<p>Related posts:<ol>
<li><a href='http://www.biaodianfu.com/google-analytics-url-no-duplication-page.html' rel='bookmark' title='使用GA在URL上添加UTM参数避免重复页面方法'>使用GA在URL上添加UTM参数避免重复页面方法</a></li>
<li><a href='http://www.biaodianfu.com/js-target-blank.html' rel='bookmark' title='使用JS让链接从新窗口打开'>使用JS让链接从新窗口打开</a></li>
<li><a href='http://www.biaodianfu.com/google-analytics-page-loading-time.html' rel='bookmark' title='使用谷歌统计来跟踪网页加载时间'>使用谷歌统计来跟踪网页加载时间</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.biaodianfu.com/simple-javascript-templating.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>nyroModal：强大的jQuery弹出层插件</title>
		<link>http://www.biaodianfu.com/nyromodal.html</link>
		<comments>http://www.biaodianfu.com/nyromodal.html#comments</comments>
		<pubDate>Sun, 23 May 2010 03:05:40 +0000</pubDate>
		<dc:creator>标点符</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.biaodianfu.com/?p=2149</guid>
		<description><![CDATA[nyromodal调用非常简单，只需在链接上加上class=”nyroModal”即可。 支持模拟对话框类型： ajax调用： &#60;a href=”http://nyromodal.nyrodev.com/demoSent.php” class=”nyroModal”&#62;Ajax&#60;/a&#62; ajax调用并支持抽取制定内容： 如果只需要显示页面上某一个元素，那么只需要在请求时把该元素ID号做为锚点加入请求地址中。以下代码只显示demoSent.php中ID号为UserInfo的元素，如果UserInfo不存在，则显示所有内容。 &#60;a href=”http://nyromodal.nyrodev.com/demoSent.php#UserInfo” class=”nyroModal”&#62;Ajax&#60;/a&#62; 单张图片显示（会自动缩放图片大小） &#60;a href=”http://nyromodal.nyrodev.com/img/img2.jpg” class=”nyroModal” title=”3rd Street Promenade”&#62;Image&#60;/a&#62; 具体使用方法，请看官方网站的实例。 官方网址：http://nyromodal.nyrodev.com/ Related posts: 图片验证码的识别技术 PHP类：htmlSQL 《Google API大全》图书推荐]]></description>
			<content:encoded><![CDATA[<p>nyromodal调用非常简单，只需在链接上加上class=”nyroModal”即可。</p>
<p>支持模拟对话框类型：</p>
<p><strong>ajax调用：</strong></p>
<p>&lt;a href=”http://nyromodal.nyrodev.com/demoSent.php” class=”nyroModal”&gt;Ajax&lt;/a&gt;</p>
<p><strong>ajax调用并支持抽取制定内容：</strong></p>
<p>如果只需要显示页面上某一个元素，那么只需要在请求时把该元素ID号做为锚点加入请求地址中。以下代码只显示demoSent.php中ID号为UserInfo的元素，如果UserInfo不存在，则显示所有内容。</p>
<p>&lt;a href=”http://nyromodal.nyrodev.com/demoSent.php#UserInfo” class=”nyroModal”&gt;Ajax&lt;/a&gt;</p>
<p><strong>单张图片显示（会自动缩放图片大小）</strong></p>
<p>&lt;a href=”http://nyromodal.nyrodev.com/img/img2.jpg” class=”nyroModal” title=”3rd Street Promenade”&gt;Image&lt;/a&gt;</p>
<p>具体使用方法，请看官方网站的实例。</p>
<p>官方网址：http://nyromodal.nyrodev.com/</p>
<p>Related posts:<ol>
<li><a href='http://www.biaodianfu.com/captcha-decode.html' rel='bookmark' title='图片验证码的识别技术'>图片验证码的识别技术</a></li>
<li><a href='http://www.biaodianfu.com/htmlsql.html' rel='bookmark' title='PHP类：htmlSQL'>PHP类：htmlSQL</a></li>
<li><a href='http://www.biaodianfu.com/google-api-daquan.html' rel='bookmark' title='《Google API大全》图书推荐'>《Google API大全》图书推荐</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.biaodianfu.com/nyromodal.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery.Switchable一款Tabs、Slide、Scrollable整合插件</title>
		<link>http://www.biaodianfu.com/jquery-switchable.html</link>
		<comments>http://www.biaodianfu.com/jquery-switchable.html#comments</comments>
		<pubDate>Thu, 18 Mar 2010 15:37:17 +0000</pubDate>
		<dc:creator>标点符</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.biaodianfu.com/?p=1943</guid>
		<description><![CDATA[jQuery.Switchable是一款整合了Tabs、Slide、Scrollable等常见UI组件的jQuery插件。  jQuery.Switchable能实现的功能有： 1.TAB切换功能 2.Slide幻灯片功能 3.Scrollable跑马灯 官方网址：http://ilikejquery.com/switchable/ 下载地址：http://code.google.com/p/mrzhang/downloads/list 演示地址：http://www.taobao.com Related posts: jQuery EasyInsert 插件，迅速添加表单 Google Public DNS 输入法]]></description>
			<content:encoded><![CDATA[<p><strong>jQuery.Switchable</strong>是一款整合了Tabs、Slide、Scrollable等常见UI组件的jQuery插件。</p>
<p> jQuery.Switchable能实现的功能有：</p>
<p>1.TAB切换功能</p>
<p><img class="alignnone size-full wp-image-1944" title="tabs" src="http://www.biaodianfu.com/wp-content/uploads/2010/03/tabs.png" alt="" width="357" height="91" /></p>
<p>2.Slide幻灯片功能</p>
<p><img class="alignnone size-full wp-image-1945" title="slide" src="http://www.biaodianfu.com/wp-content/uploads/2010/03/slide.png" alt="" width="472" height="157" /></p>
<p>3.Scrollable跑马灯</p>
<p><img class="alignnone size-full wp-image-1946" title="Scrollable" src="http://www.biaodianfu.com/wp-content/uploads/2010/03/Scrollable.png" alt="" width="423" height="104" /></p>
<p>官方网址：<a href="http://ilikejquery.com/switchable/">http://ilikejquery.com/switchable/</a></p>
<p>下载地址：<a href="http://code.google.com/p/mrzhang/downloads/list">http://code.google.com/p/mrzhang/downloads/list</a></p>
<p>演示地址：<a href="http://www.taobao.com">http://www.taobao.com</a></p>
<p>Related posts:<ol>
<li><a href='http://www.biaodianfu.com/jquery-easyinsert.html' rel='bookmark' title='jQuery EasyInsert 插件，迅速添加表单'>jQuery EasyInsert 插件，迅速添加表单</a></li>
<li><a href='http://www.biaodianfu.com/google-public-dns.html' rel='bookmark' title='Google Public DNS'>Google Public DNS</a></li>
<li><a href='http://www.biaodianfu.com/shurufa.html' rel='bookmark' title='输入法'>输入法</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.biaodianfu.com/jquery-switchable.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery EasyInsert 插件，迅速添加表单</title>
		<link>http://www.biaodianfu.com/jquery-easyinsert.html</link>
		<comments>http://www.biaodianfu.com/jquery-easyinsert.html#comments</comments>
		<pubDate>Thu, 18 Mar 2010 00:11:37 +0000</pubDate>
		<dc:creator>标点符</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.biaodianfu.com/?p=1940</guid>
		<description><![CDATA[插件主要功能：自动添加删除单个文本输入框或多个文本输入框，限制输入框数量，可以添加删除文本域、密码域、多选框、文件上传域及关联下拉菜单。 官方网站（演示）：http://ilikejquery.com/EasyInsert/ 插件下载地址：http://mrzhang.googlecode.com/files/EasyInsert-4.0.7z Related posts: jQuery.Switchable一款Tabs、Slide、Scrollable整合插件 IE7.JS 解决IE兼容性问题 SuperFish一款基于jQuery的级联下拉菜单]]></description>
			<content:encoded><![CDATA[<p>插件主要功能：自动添加删除单个文本输入框或多个文本输入框，限制输入框数量，可以添加删除文本域、密码域、多选框、文件上传域及关联下拉菜单。</p>
<p><img class="alignnone size-full wp-image-1941" title="EasyInsert" src="http://www.biaodianfu.com/wp-content/uploads/2010/03/EasyInsert.png" alt="" width="552" height="475" /></p>
<p>官方网站（演示）：<a href="http://ilikejquery.com/EasyInsert/">http://ilikejquery.com/EasyInsert/</a></p>
<p>插件下载地址：<a href="http://mrzhang.googlecode.com/files/EasyInsert-4.0.7z" target="_blank">http://mrzhang.googlecode.com/files/EasyInsert-4.0.7z</a></p>
<p>Related posts:<ol>
<li><a href='http://www.biaodianfu.com/jquery-switchable.html' rel='bookmark' title='jQuery.Switchable一款Tabs、Slide、Scrollable整合插件'>jQuery.Switchable一款Tabs、Slide、Scrollable整合插件</a></li>
<li><a href='http://www.biaodianfu.com/jiejue-ie6-jianrong-wenti-ie7js.html' rel='bookmark' title='IE7.JS 解决IE兼容性问题'>IE7.JS 解决IE兼容性问题</a></li>
<li><a href='http://www.biaodianfu.com/superfish-jquery.html' rel='bookmark' title='SuperFish一款基于jQuery的级联下拉菜单'>SuperFish一款基于jQuery的级联下拉菜单</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.biaodianfu.com/jquery-easyinsert.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery边框圆角插件：DivCorners</title>
		<link>http://www.biaodianfu.com/divcorners.html</link>
		<comments>http://www.biaodianfu.com/divcorners.html#comments</comments>
		<pubDate>Tue, 02 Mar 2010 15:52:55 +0000</pubDate>
		<dc:creator>标点符</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.biaodianfu.com/?p=1875</guid>
		<description><![CDATA[什么是 DivCorners?这个插件的主要作用是建立一个简单的方法为屏幕上的内容增加边界样式。边界样式可以是圆角，简单的边界，褪色的边缘，盒布局等。使用现有的图片来生成样式，我会完善函数，使在没有图片的情况下也能生成边界样式的。
]]></description>
			<content:encoded><![CDATA[<p><strong>什么是 DivCorners?</strong></p>
<p>这个插件的主要作用是建立一个简单的方法为屏幕上的内容增加边界样式。</p>
<ol>
<li>边界样式可以是圆角，简单的边界，褪色的边缘，盒布局等。</li>
<li>使用现有的图片来生成样式，我会完善函数，使在没有图片的情况下也能生成边界样式的。</li>
</ol>
<p>它有三个可在jquery.js和jquery.divcorners.js加载后调用的函数。</p>
<ol>
<li>使用 <strong>$(expression).dcCreate( object [, boolean] ) </strong>创建布局的实例。</li>
<li>使用 <strong>$(expression).dcResize( [boolean] )</strong> 重新调整布局的一个实例。</li>
<li>使用 <strong>$(expression).dcClear( [boolean] )</strong> 消除布局的实例。</li>
</ol>
<p>DivCorners是由jquery.divcorners.js和jquery.divcorners.css构成的，两者必须结合起来使用。</p>
<p><strong>为什么选择 DivCorners?</strong></p>
<p>“jQuery 是一个快速的，简洁的 javaScript 库，使用户能更方便地处理 HTML documents、events、实现动画效果，并且方便地为网站提供 AJAX 交互。 jQuery改变了书写JavaScript的方法。”jQuery.com</p>
<p>这个插件是为了使工作更加简单。 使用 DivCorners可以节约一半时间去完成兼容各种浏览器的预期效果。此插件还修复了IE6下PNG图片透明显示问题。</p>
<p><strong>怎么使用 DivCorners?</strong></p>
<p><strong>$(expression).dcCreate( object [, boolean] )</strong></p>
<pre lang="javascript" line="0" escaped="true">// This is the maximum definition
  $("div").dcCreate({
      imgPrefix: "/images/",
      fileType: ".gif",
      expand: 4,           // optional
      radius: 0,           // optional, Note: Radius must be greater than expand. See Understand the Parameters
      position: "inside",  // optional
      resize: "img",       // optional
      exclude: "left, top" // optional
  }, true);                // Note: This parameter is optional. By default it's true.
                           // This parameter controls whether parent .dCorner instances will be resized.

// This is the recommended definition
  $("div").dcCreate({
      imgPrefix: "/images/dCorner-",
      fileType: ".gif",
      expand: 10
  });</pre>
<p><strong>$(expression).dcResize( [boolean] )</strong></p>
<div>
<div>
<pre lang="javascript" line="0" escaped="true">// Call this function when the height or width of the container is altered.
  $("div").dcResize(true);

// This is the recommended definition
  $("div").dcResize();

// Note: This function's parameter is optional. By default it's true.
// This parameter controls whether parent .dCorner instances will be resized.</pre>
</div>
</div>
<p><strong>$(expression).dcClear( [boolean] )</strong></p>
<pre lang="javascript" line="0" escaped="true">// Call this function to remove any instances.
  $("div").dcClear(true);

// This is the constructor definition
  $("div").dcClear();

// Note: This function's parameter is optional. By default it's true.
// This parameter controls whether parent .dCorner instances will be resized.</pre>
<p>官方网址：<a href="http://roydukkey.com/divcorners/">http://roydukkey.com/divcorners/</a></p>
<p>Related posts:<ol>
<li><a href='http://www.biaodianfu.com/microsoft-expression-studio-3.html' rel='bookmark' title='Microsoft Expression Studio 3 中文版下载'>Microsoft Expression Studio 3 中文版下载</a></li>
<li><a href='http://www.biaodianfu.com/simple-javascript-templating.html' rel='bookmark' title='Javascript模板引擎分享'>Javascript模板引擎分享</a></li>
<li><a href='http://www.biaodianfu.com/php-curl-class.html' rel='bookmark' title='PHP 5 curl Class'>PHP 5 curl Class</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.biaodianfu.com/divcorners.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Unit PNG Fix</title>
		<link>http://www.biaodianfu.com/unit-png-fix.html</link>
		<comments>http://www.biaodianfu.com/unit-png-fix.html#comments</comments>
		<pubDate>Wed, 17 Feb 2010 14:50:57 +0000</pubDate>
		<dc:creator>标点符</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[IE]]></category>

		<guid isPermaLink="false">http://www.biaodianfu.com/?p=1719</guid>
		<description><![CDATA[Unit PNG Fix同样是一个修复IE6无法显示透明图片的JS它的主要特点有： 非常小的JS文件，只有1KB 解决因为IE的滤镜属性所带来的影响 无论是img元素或background-image属性都能有很好的效果 在加载页面之前就能自动运行，不需要再为png图片定义任何类名 允许自动高宽 超级简单的应用方法 Unit PNG Fix怎么使用： 1).下载zip 然后,添加下面的代码到你页面的头部（一定要确保路径的正确） &#60;!--[if lt IE 7]&#62;         &#60;script type="text/javascript" src="unitpngfix.js"&#62;&#60;/script&#62; &#60;![endif]--&#62; 2).添加clear.gif到你的images 文件夹中.在js文件中,修改“var clear=“images/clear.gif” 路径为存放clear.gif的文件路径. 一些注意事项: Unit PNG Fix能够让background-repeat在ie6下工作，不过这种工作方式不是像正常的repeat图片重复的效果，而是采用了拉伸的效果。 官方网址及下载地址：http://unitinteractive.com/labs/unitpngfix.php Related posts: IE PNG Fix 2.0 PhotoSketch：图片搜索技术 使用GA在URL上添加UTM参数避免重复页面方法]]></description>
			<content:encoded><![CDATA[<p>Unit PNG Fix同样是一个修复IE6无法显示透明图片的JS它的主要特点有：</p>
<ol>
<li>非常小的JS文件，只有1KB</li>
<li>解决因为IE的滤镜属性所带来的影响</li>
<li>无论是img元素或background-image属性都能有很好的效果</li>
<li>在加载页面之前就能自动运行，不需要再为<span style="color: black;"><span style="font-family: Arial;">png</span></span><span style="color: black;"><span style="font-family: 宋体;">图片定义任何类名</span></span></li>
<li><span style="color: black;"><span style="font-family: Arial;">允许自动高宽</span></span></li>
<li><span style="color: black;"><span style="font-family: 宋体;">超级简单的应用方法</span></span></li>
</ol>
<p>Unit PNG Fix怎么使用：</p>
<p>1).下载zip 然后,添加下面的代码到你页面的头部（一定要确保路径的正确）</p>
<pre lang="javascript" line="0" escaped="true">&lt;!--[if lt IE 7]&gt;
        &lt;script type="text/javascript" src="unitpngfix.js"&gt;&lt;/script&gt;
&lt;![endif]--&gt;</pre>
<p>2).添加clear.gif到你的images 文件夹中.在js文件中,修改“var clear=“images/clear.gif” 路径为存放clear.gif的文件路径.</p>
<p><strong>一些注意事项:</strong></p>
<p>Unit PNG Fix能够让background-repeat在ie6下工作，不过这种工作方式不是像正常的repeat图片重复的效果，而是采用了拉伸的效果。</p>
<p>官方网址及下载地址：<a href="http://unitinteractive.com/labs/unitpngfix.php">http://unitinteractive.com/labs/unitpngfix.php</a></p>
<p>Related posts:<ol>
<li><a href='http://www.biaodianfu.com/ie-png-fix-2-0.html' rel='bookmark' title='IE PNG Fix 2.0'>IE PNG Fix 2.0</a></li>
<li><a href='http://www.biaodianfu.com/photosketch.html' rel='bookmark' title='PhotoSketch：图片搜索技术'>PhotoSketch：图片搜索技术</a></li>
<li><a href='http://www.biaodianfu.com/google-analytics-url-no-duplication-page.html' rel='bookmark' title='使用GA在URL上添加UTM参数避免重复页面方法'>使用GA在URL上添加UTM参数避免重复页面方法</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.biaodianfu.com/unit-png-fix.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE PNG Fix 2.0</title>
		<link>http://www.biaodianfu.com/ie-png-fix-2-0.html</link>
		<comments>http://www.biaodianfu.com/ie-png-fix-2-0.html#comments</comments>
		<pubDate>Wed, 17 Feb 2010 14:30:12 +0000</pubDate>
		<dc:creator>标点符</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[IE]]></category>

		<guid isPermaLink="false">http://www.biaodianfu.com/?p=1717</guid>
		<description><![CDATA[IE PNG Fix 2.0是通过页面标签使用behavior:url(”iepngfix.htc”);来调用外部包含js、css的iepngfix.htc文件來修正PNG alpha 透明度。 IE PNG Fix 2.0支持以图片方式插入透明png和以CSS背景方式插入透明png。 需要注意的是： images目录的blank.gif透明图片作为png图片的替换,如目录有变请修改iepngfix.htc里blank.gif代码路径 iepngfix.htc为IE6所用,本例子以”_”hack作为区分 应用有PNG透明图片的标签,均要读取behavior:url(“iepngfix.htc”) iepngfix方法在背景应用上只能做到background-image的效果, 背景重复坐标调用等暂时实现不了 透明png背景图片会以所在层的宽高度拉伸填充,border计算在层的宽高内 官方网址及下载地址：http://www.twinhelix.com/css/iepngfix/ Related posts: Unit PNG Fix DD_belatedPNG.js让IE6支持透明PNG图片 PX转EM 字体大小在线互换程序]]></description>
			<content:encoded><![CDATA[<p>IE PNG Fix 2.0是通过页面标签使用behavior:url(”iepngfix.htc”);来调用外部包含js、css的iepngfix.htc文件來修正PNG alpha 透明度。</p>
<p>IE PNG Fix 2.0支持以图片方式插入透明png和以CSS背景方式插入透明png。</p>
<p>需要注意的是：</p>
<ol>
<li>images目录的blank.gif透明图片作为png图片的替换,如目录有变请修改iepngfix.htc里blank.gif代码路径</li>
<li>iepngfix.htc为IE6所用,本例子以”_”hack作为区分</li>
<li>应用有PNG透明图片的标签,均要读取behavior:url(“iepngfix.htc”)</li>
<li>iepngfix方法在背景应用上只能做到background-image的效果, 背景重复坐标调用等暂时实现不了</li>
<li>透明png背景图片会以所在层的宽高度拉伸填充,border计算在层的宽高内</li>
</ol>
<p>官方网址及下载地址：<a href="http://www.twinhelix.com/css/iepngfix/">http://www.twinhelix.com/css/iepngfix/</a></p>
<p>Related posts:<ol>
<li><a href='http://www.biaodianfu.com/unit-png-fix.html' rel='bookmark' title='Unit PNG Fix'>Unit PNG Fix</a></li>
<li><a href='http://www.biaodianfu.com/dd_belatedpng-js.html' rel='bookmark' title='DD_belatedPNG.js让IE6支持透明PNG图片'>DD_belatedPNG.js让IE6支持透明PNG图片</a></li>
<li><a href='http://www.biaodianfu.com/px-to-em.html' rel='bookmark' title='PX转EM 字体大小在线互换程序'>PX转EM 字体大小在线互换程序</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.biaodianfu.com/ie-png-fix-2-0.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DD_belatedPNG.js让IE6支持透明PNG图片</title>
		<link>http://www.biaodianfu.com/dd_belatedpng-js.html</link>
		<comments>http://www.biaodianfu.com/dd_belatedpng-js.html#comments</comments>
		<pubDate>Wed, 17 Feb 2010 11:20:50 +0000</pubDate>
		<dc:creator>标点符</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[IE]]></category>

		<guid isPermaLink="false">http://www.biaodianfu.com/?p=1710</guid>
		<description><![CDATA[DD_belatedPNG.js 是一个能是IE6支持p显示ng透明图片，而且还支持背景循环（background-repeat）和定位（backgrond-position） ，支持focus，Hover。 使用方法： &#60;!--[if IE 6]&#62; &#60;script src="DD_belatedPNG.js"&#62;&#60;/script&#62; &#60;script&#62; DD_belatedPNG.fix('.png_bg'); &#60;/script&#62; &#60;![endif]--&#62; 其中: DD_belatedPNG.js 为文件路径，.png_bg 为需要引用的容器名，如果需要多处引用可以使用如下方法： DD_belatedPNG.fix('.example1, .example2, img'); 其中.example1 和 .example2 为class 选择器，img 就是标签了。 如果需要修复页面上的所有PNG图片，则可以使用 DD_belatedPNG.fix(‘*');  官方网站：http://www.dillerdesign.com/experiment/DD_belatedPNG 除了DD_belatedPNG.js之外，我们以前介绍过的IE7.js也可以解决PNG透明图片在IE下不显示的问题。 Related posts: IE7.JS 解决IE兼容性问题 使用Selectivizr让IE6~8支持CSS3 SuperFish一款基于jQuery的级联下拉菜单]]></description>
			<content:encoded><![CDATA[<p>DD_belatedPNG.js 是一个能是IE6支持p显示ng透明图片，而且还支持背景循环（background-repeat）和定位（backgrond-position）<strong> </strong>，支持focus，Hover。</p>
<p><strong>使用方法：</strong></p>
<pre lang="javascript" line="0" escaped="true">&lt;!--[if IE 6]&gt;
&lt;script src="DD_belatedPNG.js"&gt;&lt;/script&gt;
&lt;script&gt;
DD_belatedPNG.fix('.png_bg');
&lt;/script&gt;
&lt;![endif]--&gt;</pre>
<p>其中:<br />
DD_belatedPNG.js 为文件路径，.png_bg 为需要引用的容器名，如果需要多处引用可以使用如下方法：</p>
<pre lang="javascript" line="0" escaped="true">DD_belatedPNG.fix('.example1, .example2, img');</pre>
<p>其中.example1 和 .example2 为class 选择器，img 就是标签了。</p>
<p>如果需要修复页面上的所有PNG图片，则可以使用</p>
<pre lang="javascript" line="0" escaped="true">DD_belatedPNG.fix(‘*'); </pre>
<p>官方网站：<a rel="external" href="http://www.dillerdesign.com/experiment/DD_belatedPNG/" target="_blank">http://www.dillerdesign.com/experiment/DD_belatedPNG</a></p>
<p>除了DD_belatedPNG.js之外，我们以前介绍过的<a href="http://www.biaodianfu.com/jiejue-ie6-jianrong-wenti-ie7js.html">IE7.js</a>也可以解决PNG透明图片在IE下不显示的问题。</p>
<p>Related posts:<ol>
<li><a href='http://www.biaodianfu.com/jiejue-ie6-jianrong-wenti-ie7js.html' rel='bookmark' title='IE7.JS 解决IE兼容性问题'>IE7.JS 解决IE兼容性问题</a></li>
<li><a href='http://www.biaodianfu.com/selectivizr.html' rel='bookmark' title='使用Selectivizr让IE6~8支持CSS3'>使用Selectivizr让IE6~8支持CSS3</a></li>
<li><a href='http://www.biaodianfu.com/superfish-jquery.html' rel='bookmark' title='SuperFish一款基于jQuery的级联下拉菜单'>SuperFish一款基于jQuery的级联下拉菜单</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.biaodianfu.com/dd_belatedpng-js.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery plugin: Validation 表单校验</title>
		<link>http://www.biaodianfu.com/jquery-validate-js.html</link>
		<comments>http://www.biaodianfu.com/jquery-validate-js.html#comments</comments>
		<pubDate>Wed, 17 Feb 2010 08:53:34 +0000</pubDate>
		<dc:creator>标点符</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[表单]]></category>

		<guid isPermaLink="false">http://www.biaodianfu.com/?p=1707</guid>
		<description><![CDATA[Jquery.validate.js是基于JQuery库的一个前端验证控件，功能很强大，自身集成了大多常用的验证方法。 以下列出validate自带的默认验证 required: “必选字段”, remote: “请修正该字段”, email: “请输入正确格式的电子邮件”, url: “请输入合法的网址”, date: “请输入合法的日期”, dateISO: “请输入合法的日期 (ISO).”, number: “请输入合法的数字”, digits: “只能输入整数”, creditcard: “请输入合法的信用卡号”, equalTo: “请再次输入相同的值”, accept: “请输入拥有合法后缀名的字符串”, maxlength: jQuery.format(“请输入一个长度最多是 {0} 的字符串”), minlength: jQuery.format(“请输入一个长度最少是 {0} 的字符串”), rangelength: jQuery.format(“请输入一个长度介于 {0} 和 {1} 之间的字符串”), range: jQuery.format(“请输入一个介于 {0} 和 {1} 之间的值”), max: jQuery.format(“请输入一个最大为 {0} 的值”), min: jQuery.format(“请输入一个最小为 {0} 的值”) 贴举个简单的例子： $('#EditView').validate({ [...]]]></description>
			<content:encoded><![CDATA[<p>Jquery.validate.js是基于JQuery库的一个前端验证控件，功能很强大，自身集成了大多常用的验证方法。</p>
<p>以下列出validate自带的默认验证</p>
<blockquote><p>required: “必选字段”,<br />
remote: “请修正该字段”,<br />
email: “请输入正确格式的电子邮件”,<br />
url: “请输入合法的网址”,<br />
date: “请输入合法的日期”,<br />
dateISO: “请输入合法的日期 (ISO).”,<br />
number: “请输入合法的数字”,<br />
digits: “只能输入整数”,<br />
creditcard: “请输入合法的信用卡号”,<br />
equalTo: “请再次输入相同的值”,<br />
accept: “请输入拥有合法后缀名的字符串”,<br />
maxlength: jQuery.format(“请输入一个长度最多是 {0} 的字符串”),<br />
minlength: jQuery.format(“请输入一个长度最少是 {0} 的字符串”),<br />
rangelength: jQuery.format(“请输入一个长度介于 {0} 和 {1} 之间的字符串”),<br />
range: jQuery.format(“请输入一个介于 {0} 和 {1} 之间的值”),<br />
max: jQuery.format(“请输入一个最大为 {0} 的值”),<br />
min: jQuery.format(“请输入一个最小为 {0} 的值”)</p></blockquote>
<p>贴举个简单的例子：</p>
<pre lang="javascript" line="0" escaped="true">$('#EditView').validate({
              event: "keyup",
              rules:{
                  name:{required:true},
                  cosa_commodity_group_list:{required:true}
              },
              submitHandler:function(){
                  $("#group_list &gt; option").attr("selected","selected");
                  $(this).submit();
              }
});</pre>
<p>1.<strong>event</strong>是触发校验的方式，可选值有keyup(每次按键时)，blur(当控件失去焦点时)，不使用这个参数时就只在按提交按钮时触发。</p>
<p>2.如果在提交前还需要进行一些自定义处理使用<strong>submitHandler</strong>参数。</p>
<p>3.<strong>debug</strong>，如果这个参数为true，那么表单不会提交，只进行检查，用于调试状态。</p>
<p>4.<strong>rules</strong>，所有的检验规则都写在这个参数里面.</p>
<p>格式为：ID : {rule1,rule2,&#8230;}</p>
<p>          (1) required: true  必输<br />
          (2) number: true 只能输入数字(包括小数)<br />
          (3) digits:true 只能输入整数<br />
          (4) minValue: 3 不能小于3<br />
          (5) maxValue: 100 最大不超过100<br />
          (6) rangeValue:[50,100] 值范围为50-100<br />
          (7) minLength: 5 最小长度(汉字算一个字符)<br />
          (8) maxLength: 10 最大长度(汉字算一个字符)<br />
          (9) rangeLength:[5,10] 长度范围为5至10位(汉字算一个字符)<br />
          (10) 上面的minLength, maxLength, rangeLength 这三项除了text input之外还可以用于checkbox,select这两种控件<br />
          (11) email:true 电子邮件<br />
          (12) equalTo: “#field” 与#field值相同<br />
          (13) dateISO:true 日期型，格式为2012/02/12   2010-1-14</p>
<p>5.<strong>messages</strong>，自定义错误信息，格式与rules类似：</p>
<pre lang="javascript" line="0" escaped="true">messages {
          password: {
              required: "请输入您的密码."
              minLength: "密码不能小于6位.",
              maxLength: "密码不能长于32位."
          },
</pre>
<p>官方网址：<a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">http://bassistance.de/jquery-plugins/jquery-plugin-validation/</a></p>
<p>Related posts:<ol>
<li><a href='http://www.biaodianfu.com/jquery-blockui-js.html' rel='bookmark' title='jquery.blockUI.js'>jquery.blockUI.js</a></li>
<li><a href='http://www.biaodianfu.com/jquery-form-js.html' rel='bookmark' title='jquery.form.js，JQuery表单插件'>jquery.form.js，JQuery表单插件</a></li>
<li><a href='http://www.biaodianfu.com/oct-to-base.html' rel='bookmark' title='将一个无符号十进制数转换成N(2-36)进制'>将一个无符号十进制数转换成N(2-36)进制</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.biaodianfu.com/jquery-validate-js.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In-Field Labels jQuery Plugin</title>
		<link>http://www.biaodianfu.com/jquery-infieldlabel-min-js.html</link>
		<comments>http://www.biaodianfu.com/jquery-infieldlabel-min-js.html#comments</comments>
		<pubDate>Wed, 17 Feb 2010 08:23:52 +0000</pubDate>
		<dc:creator>标点符</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[表单]]></category>

		<guid isPermaLink="false">http://www.biaodianfu.com/?p=1704</guid>
		<description><![CDATA[In-Field Labels jQuery插件是一个可以使普通输入框内显示默认信息，当用户开始输入时，输入框中默认显示的文字自动消失的插件，可以避免填入的value值。]]></description>
			<content:encoded><![CDATA[<p>In-Field Labels jQuery插件是一个可以使普通输入框内显示默认信息，当用户开始输入时，输入框中默认显示的文字自动消失的插件，可以避免填入的value值。</p>
<p>目前支持的浏览器：IE6+IE6+, WebKit Browsers (Safari, Chrome), Firefox 2+（其中需要注意的是IE6需要设置输入框的label的颜色）</p>
<p>需要注意的是：浏览器自动填充表单会照成错误，对于火狐和Chrome可以在input elements设置autocomplete=”off” 。</p>
<p>官方网址及演示：<a href="http://fuelyourcoding.com/scripts/infield/">http://fuelyourcoding.com/scripts/infield/</a></p>
<p>Related posts:<ol>
<li><a href='http://www.biaodianfu.com/google-chrome-frame.html' rel='bookmark' title='Google Chrome Frame 谷歌浏览器框架'>Google Chrome Frame 谷歌浏览器框架</a></li>
<li><a href='http://www.biaodianfu.com/jquery-validate-js.html' rel='bookmark' title='jQuery plugin: Validation 表单校验'>jQuery plugin: Validation 表单校验</a></li>
<li><a href='http://www.biaodianfu.com/uploadrobots.html' rel='bookmark' title='UploadRobots免费的网络硬盘'>UploadRobots免费的网络硬盘</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.biaodianfu.com/jquery-infieldlabel-min-js.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

