codecamp

XML DOM xmlStandalone 属性

XML DOM xmlStandalone 属性


Document 对象参考手册 Document 对象

定义和用法

xmlStandalone 属性设置或返回文档是否为 standalone。

语法

documentObject.xmlStandalone


实例

下面的代码片段使用 loadXMLDoc() 把 "books.xml" 载入 xmlDoc 中,并显示 XML 编码、standalone 属性和文档的 XML 版本:

实例

xmlDoc=loadXMLDoc("books.xml");

document.write("XML encoding: " + xmlDoc.xmlEncoding);
document.write("
");
document.write("XML standalone: " + xmlDoc.xmlStandalone);
document.write("
");
document.write("XML version: " + xmlDoc.xmlVersion);
document.write("
");
document.write("Encoding when parsing: " + xmlDoc.inputEncoding);

输出:

XML encoding: ISO-8859-1
XML standalone: false
XML version: 1.0
Encoding when parsing: ISO-8859-1

尝试一下 »

Document 对象参考手册 Document 对象
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }