2013年5月18日

create xmlhttprequest

摘要: 1 function createXHR() { 2 if (typeof XMLHttpRequest != "undefined") { 3 return new XMLHttpRequest(); 4 } else if (typeof ActiveXObject != "undefined") { 5 if (typeof arguments.callee.activeXString != "string") { 6 var versions = ["MSXML2.XMLH... 阅读全文

posted @ 2013-05-18 23:44 雷音 阅读(208) 评论(0) 推荐(0) 编辑

common XSLT solution in all browser

摘要: 1 function transform(context, xslt) { 2 if (typeof XSLTProcessor != "undefined") { 3 var processor = new XSLTProcessor(); 4 processor.importStylesheet(xslt); 5 6 var result = processor.transformToDocument(context); 7 return (new XMLSerializer... 阅读全文

posted @ 2013-05-18 17:14 雷音 阅读(143) 评论(0) 推荐(0) 编辑

common Xpath solution across browser

摘要: //select single node 1 function selectsingleNode(context, expression, namespaces) { 2 var doc = (context.nodeType != 9 ? context.ownerDocument : context); 3 4 if (typeof doc.evaluate != "undefined") { 5 var nsresolver = null; 6 if (namespaces instanceof Objec... 阅读全文

posted @ 2013-05-18 17:02 雷音 阅读(203) 评论(0) 推荐(0) 编辑

a cross-broswer solution for serialize xml dom

摘要: 1 function serializeXml(xmldom) { 2 3 if (typeof XMLSerializer != "undefined") { 4 return (new XMLSerializer()).serializeToString(xmldom); 5 } else if (document.implementation.hasFeature("LS", "3.0")) { 6 var implementation = document.implementation; 7 ... 阅读全文

posted @ 2013-05-18 00:54 雷音 阅读(132) 评论(0) 推荐(0) 编辑

a cross-broswer solution for parse xml fragment

摘要: 1 function parseXml(xml) { 2 var xmldom = null; 3 4 if (typeof DOMParser != "undefined") { 5 xmldom = (new DOMParser()).parseFromString(xml, "text/xml"); 6 var errors = xmldom.getElementByTagName("parsererror"); 7 if (errors.length) { 8 ... 阅读全文

posted @ 2013-05-18 00:25 雷音 阅读(158) 评论(0) 推荐(0) 编辑

导航