﻿<?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>Gavin&#039;s Blog &#187; Javascript面向对象</title>
	<atom:link href="http://laigw.name/tag/javascript%e9%9d%a2%e5%90%91%e5%af%b9%e8%b1%a1/feed" rel="self" type="application/rss+xml" />
	<link>http://laigw.name</link>
	<description>Keep it simple, stupid. Simplicity is beauty.</description>
	<lastBuildDate>Sun, 29 Jan 2012 07:14:51 +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>自写一个较通用的Ajax处理类</title>
		<link>http://laigw.name/post/108.html</link>
		<comments>http://laigw.name/post/108.html#comments</comments>
		<pubDate>Sat, 15 Nov 2008 09:20:42 +0000</pubDate>
		<dc:creator>Gavin</dc:creator>
				<category><![CDATA[Web前端技术]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Javascript面向对象]]></category>

		<guid isPermaLink="false">http://www.laigw.name/?p=108</guid>
		<description><![CDATA[出于工作和学习的需要，参考《Ajax in Action》一书，自写了一个较通用的Ajax处理类：AjaxObject。通过创建一个AjaxObject实例，调用其方法：
sendRequest();
就可以实现对服务器的异步请求和响应，而且不受全局变量的限制。
其代码如下：


&#160;查看代码 JAVASCRIPT1
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/*
&#160;
* define a javascript class, this is its constructor.
&#160;
* For using this class object, make sure define an outer Ajax Component(may be an object) &#34;ajaxComponent&#34;,
&#160;
* which must has two methods: handleMessage(req) and handleError(req),
&#160;
* for responsing handling successful message and error message.
&#160;
*/
&#160;
AjaxObject = function&#40;ajaxComponent, url, method&#41;&#123;
&#160;
this.ajaxComponent = ajaxComponent;
&#160;
this.url = url;
&#160;
this.method = method ? [...]]]></description>
		<wfw:commentRss>http://laigw.name/post/108.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

