Web page effects load XML file multiple methods (compatible Ff,ie6+,opera) Below we provide three kinds of JS loading XML documents, each load XML file method is different, but the principle is the same, the best is the third section, the instance is compatible with multiple browsers, the second instance of the, copy down can be directly used Method One
var xmldoc; Try{//ie Create an empty Microsoft XML Document Object Xmldoc=new ActiveXObject ("Microsoft.XMLDOM"); }catch (e) { Try{//ff Create an empty XML Document object Xmldoc=document.implementation.createdocument ("", "", null); }catch (e) { alert (e.message); } } try{ Turns off asynchronous loading, which ensures that the parser does not continue to execute scripts until the document is fully loaded Xmldoc.async=false; Load XML document Xmldoc.load (Xml_file); }catch (e) { alert (e.message); return false; } return xmldoc; Method Two, JS loads the XML and displays it
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.