eBusiness Technik
posts - 4, comments - 3, trackbacks - 0, articles - 0
導航
首頁
新隨筆
聯系
聚合
管理
<
2007年2月
>
日
一
二
三
四
五
六
28
29
30
31
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
1
2
3
4
5
6
7
8
9
10
常用鏈接
我的隨筆
我的評論
我的參與
最新評論
留言簿
(1)
給我留言
查看公開留言
查看私人留言
隨筆分類
(3)
AJAX(1)
EJB3
JSP(1)
PHP
Projects(1)
SOAP - WSDL - XML
隨筆檔案
(4)
2007年3月 (2)
2007年2月 (2)
文章分類
原創
翻譯
轉載
相冊
My-eBay
搜索
最新評論
1.?re: PHP & MySQL 實現用戶登錄驗證[未登錄]
dfg
--zy
2.?re: PHP & MySQL 實現用戶登錄驗證
asasasas
--123
3.?re: My-eBay的設計和實現
小b又瞎弄blog, 肯定過不了幾天就會遺棄這里。
項目具體的信息還是暫時先通過email,以防泄密,具體的以后再補上。
現階段主要任務是目標系統的定義。
--cc88
閱讀排行榜
1.? PHP & MySQL 實現用戶登錄驗證 (850)
2.?My-eBay的設計和實現(265)
3.?Ajax開發記錄一: xmlhttp創建的一種方式(187)
4.?Ajax開發記錄二: xmlhttp創建的另一種方式 (182)
評論排行榜
1.? PHP & MySQL 實現用戶登錄驗證 (2)
2.?My-eBay的設計和實現(1)
3.?Ajax開發記錄二: xmlhttp創建的另一種方式 (0)
4.?Ajax開發記錄一: xmlhttp創建的一種方式(0)
Ajax開發記錄二: xmlhttp創建的另一種方式
Posted on 2007-02-28 15:48
青島小哥
閱讀(182)
評論(0)
編輯
收藏
另一種創建方式。似乎更加簡潔明了。用2個function完美的創建和調用xmlhttp Object。
?1
????
//
xmlhttp.js
?2
????
?3
????
//
Function?to?create?an?XMLHttp?Object.
?4
????
function
?getxmlhttp?()
{
?5
????????
//
Create?a?boolean?variable?to?check?for?a?valid?microsoft?active?X?instance.
?6
????????
var
?xmlhttp?
=
?
false
;
?7
????????
?8
????????
//
Check?if?we?are?using?internet?explorer.
?9
????????
try
?
{
10
????????????
//
If?the?javascript?version?is?greater?than?5.
11
????????????xmlhttp?
=
?
new
?ActiveXObject(
"
Msxml2.XMLHTTP
"
);
12
????????}
?
catch
?(e)?
{
13
????????????
//
If?not,?then?use?the?older?active?x?object.
14
????????????
try
?
{
15
????????????????
//
If?we?are?using?internet?explorer.
16
????????????????xmlhttp?
=
?
new
?ActiveXObject(
"
Microsoft.XMLHTTP
"
);
17
????????????}
?
catch
?(E)?
{
18
????????????????
//
Else?we?must?be?using?a?non-internet?explorer?browser.
19
????????????????xmlhttp?
=
?
false
;
20
????????????}
21
????????}
22
????????
23
????????
//
If?we?are?using?a?non-internet?explorer?browser,?create?a?javascript?instance?of?the?object.
24
????????
if
?(
!
xmlhttp?
&&
?
typeof
?XMLHttpRequest?
!=
?'undefined')?
{
25
????????????xmlhttp?
=
?
new
?XMLHttpRequest();
26
????????}
27
????????
28
????????
return
?xmlhttp;
29
????}
30
????
31
????
//
Function?to?process?an?XMLHttpRequest.
32
????
function
?processajax?(obj,?serverPage)
{
33
????????
//
Get?an?XMLHttpRequest?object?for?use.
34
????????
var
?theimg;
35
????????xmlhttp?
=
?getxmlhttp?();
36
????????xmlhttp.open(
"
GET
"
,?serverPage);
37
????????xmlhttp.onreadystatechange?
=
?
function
()?
{
38
????????????
if
?(xmlhttp.readyState?
==
?
4
?
&&
?xmlhttp.status?
==
?
200
)?
{
39
????????????????document.getElementById(obj).innerHTML?
=
?xmlhttp.responseText;
40
????????????}
41
????????}
42
????????xmlhttp.send(
null
);
43
????}
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
Powered by:
BlogJava
Copyright © 青島小哥
主站蜘蛛池模板:
祁门县
|
威信县
|
封开县
|
剑河县
|
西城区
|
和静县
|
邛崃市
|
洞头县
|
隆林
|
凤阳县
|
巴南区
|
类乌齐县
|
林甸县
|
巨野县
|
东方市
|
巴楚县
|
申扎县
|
海口市
|
阆中市
|
岱山县
|
余干县
|
呼伦贝尔市
|
巢湖市
|
秦皇岛市
|
巨鹿县
|
同仁县
|
工布江达县
|
清原
|
黄平县
|
太仓市
|
望谟县
|
宁城县
|
洪雅县
|
包头市
|
南昌市
|
河源市
|
福泉市
|
五家渠市
|
舟山市
|
龙泉市
|
昌邑市
|