HTML DOM Document ¶ÔÏó
Document ¶ÔÏó
Document ¶ÔÏó´ú±íÕû¸ö HTML Îĵµ£¬¿ÉÓÃÀ´·ÃÎÊÒ³ÃæÖеÄËùÓÐÔªËØ¡£
Document ¶ÔÏóÊÇ Window ¶ÔÏóµÄÒ»¸ö²¿·Ö£¬¿Éͨ¹ý window.document ÊôÐÔÀ´·ÃÎÊ¡£
ÓÐ¹Ø Document ¶ÔÏóµÄÏêϸÃèÊö¡£
IE: Internet Explorer, F: Firefox, O: Opera, W3C: World Wide Web Consortium (Internet ±ê×¼).
Document ¶ÔÏóµÄ¼¯ºÏ
¼¯ºÏÃèÊöIEFOW3C
all[]
Ìṩ¶ÔÎĵµÖÐËùÓÐ HTML ÔªËصķÃÎÊ¡£
4
1
9
Yes
anchors[]
·µ»Ø¶ÔÎĵµÖÐËùÓÐ Anchor ¶ÔÏóµÄÒýÓá£
4
1
9
Yes
applets
·µ»Ø¶ÔÎĵµÖÐËùÓÐ Applet ¶ÔÏóµÄÒýÓá£
-
-
-
-
forms[]
·µ»Ø¶ÔÎĵµÖÐËùÓÐ Form ¶ÔÏóÒýÓá£
4
1
9
Yes
images[]
·µ»Ø¶ÔÎĵµÖÐËùÓÐ Image ¶ÔÏóÒýÓá£
4
1
9
Yes
links[]
·µ»Ø¶ÔÎĵµÖÐËùÓÐ Area ºÍ Link ¶ÔÏóÒýÓá£
4
1
9
Yes
Document ¶ÔÏóµÄÊôÐÔ
ÊôÐÔÃèÊöIEFOW3C
body
Ìṩ¶Ô <body> ÔªËصÄÖ±½Ó·ÃÎÊ¡£¶ÔÓÚ¶¨ÒåÁË¿ò¼Ü¼¯µÄÎĵµ£¬¸ÃÊôÐÔÒýÓÃ×îÍâ²ãµÄ <frameset>¡£
cookie
ÉèÖûò·µ»ØÓ뵱ǰÎĵµÓйصÄËùÓÐ cookie¡£
4
1
9
Yes
domain
·µ»Øµ±Ç°ÎĵµµÄÓòÃû¡£
4
1
9
Yes
lastModified
·µ»ØÎĵµ±»×îºóÐ޸ĵÄÈÕÆÚºÍʱ¼ä¡£
4
1
No
No
referrer
·µ»ØÔØÈ뵱ǰÎĵµµÄÎĵµµÄ URL¡£
4
1
9
Yes
title
·µ»Øµ±Ç°ÎĵµµÄ±êÌâ¡£
4
1
9
Yes
URL
·µ»Øµ±Ç°ÎĵµµÄ URL¡£
4
1
9
Yes
Document ¶ÔÏóµÄ·½·¨
·½·¨ÃèÊöIEFOW3C
close()
¹Ø±ÕÓà document.open() ·½·¨´ò¿ªµÄÊä³öÁ÷£¬²¢ÏÔʾѡ¶¨µÄÊý¾Ý¡£
4
1
9
Yes
getElementById()
·µ»Ø¶ÔÓµÓÐÖ¸¶¨ id µÄµÚÒ»¸ö¶ÔÏóµÄÒýÓá£
5
1
9
Yes
getElementsByName()
·µ»Ø´øÓÐÖ¸¶¨Ãû³ÆµÄ¶ÔÏ󼯺ϡ£
5
1
9
Yes
getElementsByTagName()
·µ»Ø´øÓÐÖ¸¶¨±êÇ©ÃûµÄ¶ÔÏ󼯺ϡ£
5
1
9
Yes
open()
´ò¿ªÒ»¸öÁ÷£¬ÒÔÊÕ¼¯À´×ÔÈκΠdocument.write() »ò document.writeln() ·½·¨µÄÊä³ö¡£
4
1
9
Yes
write()
ÏòÎĵµÐ´ HTML ±í´ïʽ »ò JavaScript ´úÂë¡£
4
1
9
Yes
writeln()
µÈͬÓÚ write() ·½·¨£¬²»Í¬µÄÊÇÔÚÿ¸ö±í´ïʽ֮ºóдһ¸ö»»Ðзû¡£
4
1
9
Yes
Document ¶ÔÏóµÄÃèÊö
HTMLDocument ½Ó¿Ú¶Ô DOM Document ½Ó¿Ú½øÐÐÁËÀ©Õ¹£¬¶¨Òå HTML רÓõÄÊôÐԺͷ½·¨¡£
ºÜ¶àÊôÐԺͷ½·¨¶¼ÊÇ HTMLCollection ¶ÔÏó£¨Êµ¼ÊÉÏÊÇ¿ÉÒÔÓÃÊý×é»òÃû³ÆË÷ÒýµÄÖ»¶ÁÊý×飩£¬ÆäÖб£´æÁ˶Ôê¡¢±íµ¥¡¢Á´½ÓÒÔ¼°ÆäËû¿É½Å±¾ÔªËصÄÒýÓá£
ÕâЩ¼¯ºÏÊôÐÔ¶¼Ô´×
Ïà¹ØÎĵµ£º
Èç¹ûÓÃwebbrowserµÄdocumentÈ¥»ñÈ¡IFrameÕâ¸ö¶ÔÏó£¬ËæºóÒ»¶¨»áµÃµ½accessdeniedµÄ´íÎó£¬ÎªÊ²Ã´£¿
ÕÒÁËһϣ¬¾Ý˵ÊDz»ÄÜ¿çÓò·ÃÎÊ...
ÖÕÓÚÓÐÒ»Ì죬ÊÔÁËһϣ¬ÔÚOnDocumentCompleteʼþÀïÃæ·µ»ØµÄdispatch¾ÍÊÇiframeµÄIHTMLWindow2¶ÔÏó£¬ÔÚÄÇÀï¿ÉÒÔ²Ù×÷ËùÓеĶÔÏó£¬È»ºó£¬ÄãÏë×öʲô¾ÍËæÄãÁË£¬²»ÖªµÀÈç¹ûÕâ¸öʱºò±£´æÁËÕâ¸öI ......
¸ù¾Ý¼ôÌù°åµÄÔÀí£¬ÔÚ»ñÈ¡¼ôÌù°åÄÚÈÝ֮ǰ£¬±ØÐëÖ¸¶¨Òª»ñÈ¡ÄÚÈݵĸñʽ¡£ÓÉÓÚ¼ôÌù°åÖеÄÊý¾Ý¿ÉÄÜ´æÔÚ¶àÖÖ¸ñʽ£¬ËùÒÔÓбØÒª¶Ô¼ôÌù°åµÄ¸ñʽÀàÐÍÏÈ×öһЩÁ˽⡣WдÏÂÁËÒÔϵIJâÊÔ´úÂ룺
procedure TForm1.Button3Click(Sender: TObject);
var
i: integer;
Buffer: PChar;
s: string;
begin
M ......
ÑÕ ÁÖ
, Èí¼þ¹¤³Ìʦ, IBM
2009 Äê 12 ÔÂ 10 ÈÕ
HTML
5 ÒýÈëÁËеĵÄÍøÒ³ÔªËØ£º<canvas>¡£Canvas ÊÇһƬ¿Õ°×µÄ»æͼÇøÓò£¬ÍøÒ³¿ª·¢Õß¿ÉÒÔÀûÓà JavaScript
ÔÚ¸ÃÇøÓòÖÐ×ÔÓɵؽøÐÐ 2D »æͼ¡£Canvas ¿ÉÒÔÓÃÓÚäÖȾ»ªÀöµÄÍøÒ³Éè¼Æ½çÃæ¡£±¾ÎÄͨ¹ýÒ»¸öÏêϸµÄʵÀýÀ´ËµÃ÷ÈçºÎÓà Canvas
À´ÖÆ×÷Ò»¸öͼƬµÄä¯ÀÀÆ÷¡£×îÖÕµÄÐ ......
³ýÁËÄÚÖÃµÄ JavaScript ¶ÔÏóÒÔÍ⣬Ä㻹¿ÉÒÔʹÓà JavaScript ·ÃÎʲ¢´¦ÀíËùÓÐµÄ HTML DOM ¶ÔÏó¡£
¸ü¶à JavaScript ¶ÔÏó
µã»÷ÒÔÏÂÁ´½Ó£¬¿ÉÒÔ»ñµÃÒÔ϶ÔÏóµÄ¸ü¶àÐÅÏ¢£¬°üÀ¨ËüÃǵļ¯ºÏ¡¢ÊôÐÔ¡¢·½·¨ÒÔ¼°Ê¼þ¡£
¶ÔÏóÃèÊö
Window
JavaScript ²ã¼¶ÖеĶ¥²ã¶ÔÏó¡£Windows ¶ÔÏó»á³ÊÏÖ (represent) Ò»¸öä¯ÀÀÆ÷´°¿Ú¡£Ã¿µ± <body& ......
<html>
<script language="javascript" defer>
function isvalid()
{
Input_Str=document.getElementById("tsinput").value;
document.getElementById("ts").innerHTML=Input_Str;
if(Input_Str!=document.getElementById("ts").innerText)
alert("include Html Element... ......