作者albb0920 (么柏)
看板Web_Design
標題Re: [閒聊] 過時的架構
時間Thu Jul 31 12:31:06 2008
: 推 alpe:好像 innerHTML innerXXX 都不是標準之內的東西 XD 07/31 09:50
還真的不是 囧"
http://www.w3.org/TR/WCAG20-TECHS/SCR21.html
Description
The objective of this technique is to demonstrate how to use functions of the
Document Object Model (DOM) to add content to a page instead of using
document.write or object.innerHTML. The document.write() method does not work
with XHTML when served with the correct MIME type (application/xhtml+xml),
and
the innerHTML property is not part of the DOM specification and thus
should be avoided. If the DOM functions are used to add the content, user
agents can access the DOM to retrieve the content. The createElement()
function can be used to create elements within the DOM.
The createTextNode()
is used to create text associated with elements. The appendChild(),
removeChild(), insertBefore() and replaceChild() functions are used to add
and remove elements and nodes. Other DOM functions are used to assign
attributes to the created elements.
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.134.147.245
推 cjoe:不是標準,但是在很多ajax套件都看的到,例如YUI 07/31 13:31
推 kewl:原來如此,受教了... 07/31 14:02
推 KiroKu:我還滿常用innerHTML噎... 07/31 17:42