ExtJS write dynamically generated XML (compatible with Firefox) _extjs

Source: Internet
Author: User
Copy Code code as follows:

function getXml () {
Get input value
var name = Textname.getvalue ();
var pwd = Textpwd.getvalue ();
Initializing objects
var xmldoc = document.implementation.createDocument ("", "", null);
Xmldoc.async= "false";//Cancel the action submitted by the XML without completing the complete completion of the data

XML Header Authoring
var header=xmldoc.createprocessinginstruction ("xml", "version= ' 1.0");
Xmldoc.appendchild (header);

To create a child tree
var root = xmldoc.createelement ("Logininfo");
var username = xmldoc.createelement ("username");
var userpassword = xmldoc.createelement ("PassWord");
Create subtree text content
var usernametext=xmldoc.createtextnode (name);
var passwordtext=xmldoc.createtextnode (PWD);


Kishuven This content is mounted
Username.appendchild (Usernametext);
Userpassword.appendchild (Passwordtext);

Child tree Node mount
Root.appendchild (username);
Root.appendchild (UserPassword);

Root content Mount
Xmldoc.appendchild (root);

return XML text content
return xmldoc;
};

I use
Copy Code code as follows:

var dom= new ActiveXObject ()

Only IE can run, in order to be compatible, must consider Firefox users, so, this program for: Firefox user compatibility; no local XML can be generated dynamically

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.