js讀取XML資料1

2021-06-01 11:09:03 字數 1144 閱讀 9726

">

">

在phoenix的目錄下的xml資料夾裡新建xml檔案「email2.xml」:

<?xml version="1.0" encoding="utf-8"?>

[email protected]

[email protected]

[email protected]

my document is a tree.

this is an example of a tree structure.

[email protected]

[email protected]

xml is cool.

this is a ****** message.

[email protected]

[email protected]

here is that code.

i send too many emails.

然後:執行js讀取xml的資料2.html,結果如下:

email 0

to: [email protected]

from: [email protected]

cc: [email protected]

subject: my document is a tree.

body: this is an example of a tree structure.

email 1

to: [email protected]

from: [email protected]

subject: xml is cool.

body: this is a ****** message.

email 2

to: [email protected]

from: [email protected]

subject: here is that code.

body: i send too many emails.

同時,要注意大小寫,剛剛測試了很久,資料沒出來,其實是html裡面大小寫的問題!

JS讀取XML檔案

檔案 austin.js 檔案 austin.xml 安安的測試內容 green austin的測試內容 blue js讀取並輸出xml檔案節點及屬性 相容ie,ff 這個東西讓我好難找啊,不過還是找到了。好東東不能自己藏著,發出來分享一下了,book.html 如下 books.xml 如下 au...

利用js讀取xml檔案

這是標題1 這是資料1 這是標題2 這是資料2 這是標題3 這是資料3 建立xml檔案物件 傳送乙個http請求 開啟xml檔案 用open可以指定get,post 第乙個引數是請求方式,第二個引數是檔案位址,第三個引數為是否為非同步 預設為true 是 false 否 使用ajax提交的引數多是些...

xml讀取完整的xml檔案(1)

public void test throws exception 獲取當前標籤的所有子標籤 private void getchildnodes element elem,stringbuffer sb 得到文字 string content elem.gettext iteratorit ele...