<?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>welefen的随笔</title>
	<atom:link href="http://www.welefen.com/tag/instance/feed" rel="self" type="application/rss+xml" />
	<link>http://www.welefen.com</link>
	<description>前端打杂者@baidu</description>
	<lastBuildDate>Tue, 07 Feb 2012 07:28:11 +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>js动态创建类和实例化</title>
		<link>http://www.welefen.com/js%e5%8a%a8%e6%80%81%e5%88%9b%e5%bb%ba%e7%b1%bb%e5%92%8c%e5%ae%9e%e4%be%8b%e5%8c%96.html</link>
		<comments>http://www.welefen.com/js%e5%8a%a8%e6%80%81%e5%88%9b%e5%bb%ba%e7%b1%bb%e5%92%8c%e5%ae%9e%e4%be%8b%e5%8c%96.html#comments</comments>
		<pubDate>Wed, 24 Feb 2010 08:39:34 +0000</pubDate>
		<dc:creator>welefen</dc:creator>
				<category><![CDATA[前端开发]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[instance]]></category>
		<category><![CDATA[js]]></category>

		<guid isPermaLink="false">http://www.welefen.com/?p=265</guid>
		<description><![CDATA[在js中，创建一个类和实例化该类一般方式是： var cls = function(){} cls.prototype = { attr:”, method:function(){} } var clsInstance = new cls; 这种方式简单明了，但如果类很多的话就比较痛苦了，并且代码看起来不够优化。 动态创建类 动态创建类实际上类似于一种代理的模式，代码如下： var Fath = function(methods){ var cls = function(){ return new fn(arguments); }, fn = function(args){ return this.init &#38;&#38; this.init.apply &#38;&#38; this.init.apply(this,args); }; fn.prototype = cls.prototype = methods &#124;&#124; {}; try{ return cls; }finally{ cls = null; [...]]]></description>
		<wfw:commentRss>http://www.welefen.com/js%e5%8a%a8%e6%80%81%e5%88%9b%e5%bb%ba%e7%b1%bb%e5%92%8c%e5%ae%9e%e4%be%8b%e5%8c%96.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using eaccelerator
Database Caching 1/9 queries in 0.007 seconds using disk: basic
Object Caching 318/330 objects using disk: basic

Served from: welefen.com @ 2012-02-08 04:06:56 -->
