javascript¶¯Ì¬×°ÈëXMLÊý¾Ý
ʹÓÃjavascript´´½¨Microsoft XML DOM,¾Í¿ÉÒÔÍê³ÉÕâÒ»¹¤×÷.
// ×°ÈëÊý¾Ý.
var source = new ActiveXObject("Microsoft.XMLDOM");
source.async = false
source.load("history.xml");
// ×°ÈëÑùʽ±í.
var stylesheet = new ActiveXObject("Microsoft.XMLDOM");
stylesheet.async = false
stylesheet.load("history.xsl");
ʹÓÃnew ActiveXObject("Microsoft.XMLDOM")´´½¨Ò»¸öMicrosoft XML DOM, ×¢ÒâasyncµÄÊôÐÔÒ»¶¨ÒªÉèΪfalse,·ñÔò»áÒòΪ²»Í¬²½¶ø²úÉú´íÎó.
// ½«½á¹ûת»¯ÎªÒ»¸öDOMÎĵµ.
divContent.innerHTML = source.transformNode(stylesheet);
divContent¿ÉÒÔ¶¨ÒåΪ<div id="divContent"></div>.
Ïà¹ØÎĵµ£º
var
xmlDoc
=
null
;
function
parseXML
(
xmlUrl
)
{
¡¡¡¡try
{
¡¡¡¡¡¡¡¡//IE
¡¡¡¡¡¡¡¡xmlDoc
=
new
ActiveXObject
(
"Microsoft.XMLDOM"
);
¡¡¡¡¡¡¡¡xmlDoc
.
async
=
false
;
¡¡¡¡¡¡¡¡xmlDoc
......
JavascriptÊý¾ÝÀàÐÍ
ÓÉÓÚjavascriptÊÇÈõÀàÐÍÓïÑÔ£¬¼´¶¨Òå±äÁ¿Ê±²»±ØÉùÃ÷ÆäÀàÐÍ
¡£µ«Õâ²¢²»Òâζ×űäÁ¿Ã»ÓÐÀàÐÍ¡£ÒòΪ¸³ÖµÊ±»á×Ô¶¯Æ¥ÅäÊý¾ÝÀàÐÍ£¡
Ä¿Ç°Óõ½µÄ»ù±¾Êý¾ÝÀàÐÍ
number
boolean
string
var i
i="test";//Õâʱi¾Í³ÉÁËstringÀàÐÍ
var i
i=4;//Õâʱi¾Í³ÉÁËnumberÀàÐÍ
³£ÓöÔÏóÀàÐÍ<object> ......
typeof ÊÇJavaScriptµÄÔËËã·û
——·µ»ØÒ»¸öÓÃÀ´±íʾ±í´ïʽµÄÊý¾ÝÀàÐ͵Ä×Ö·û´®
typeof[(] expression [)] //typeofÓï·¨ÖеÄÔ²À¨ºÅÊÇ¿ÉÑ¡Ïî
typeof ÔËËã·û@import url(../html-vss/msdnie4a.css);
typeof
ÔËËã·û°ÑÀàÐÍÐÅÏ¢µ±×÷×Ö·û´®·µ»Ø¡£typeof
·µ»ØÖµÓÐÁ ......
Òþ²Ø³ÉÔ±±äÁ¿
ÔÚº¯ÊýÌåÄÚ¶¨ÒåµÄ±äÁ¿Îª¾Ö²¿±äÁ¿£¬À뿪º¯Êý¾Í¹ÒµôÁË
ÔÚº¯ÊýÌåÄÚʹÓÃthis.³ÉÔ±±äÁ¿Ãû£¬ÔòΪwindow¶ÔÏ󼶱äÁ¿£¬¼´È«¾Ö±äÁ¿
¹ÊÐèÒªÕâÑùÒþ²Ø³ÉÔ±±äÁ¿£¬ÏòÍâÖ»±©Â¶get¡¢setº¯Êý
function testClass(name){
var _firstname=name;
return {
getname : function() {
return _fir ......
<?
XML DOM¶ÁÈ¡½ÚµãÐÅÏ¢Óöµ½ÎÊÌâ×ܽ᣺
1:NodeList: ʹÓýڵãµÄchildNodesÊôÐÔ»òÕßdocument¶ÔÏóµÄgetElementsByTagName()·½·¨£¬¾Í»á·µ»ØÒ»¸ö°üº¬½ÚµãÁбíµÄNodeList
2: ÔÚ XML DOM ÖУ¬½ÚµãµÄ¹Øϵ±»¶¨ÒåΪ½ÚµãµÄÊôÐÔ£º
· parentNode
· childNodes
· ......