Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I need to insert data into xml file using either jquery or javascript i have done it with csharp here is my code using C#
C#
XmlDocument xmldoc = new XmlDocument();
               xmldoc.Load(Server.MapPath("Sample.xml"));
               XmlElement parentelement = xmldoc.CreateElement("Comments");
               XmlElement name = xmldoc.CreateElement("Name");
               name.InnerText =Session["Profilename"].ToString();
               XmlElement message = xmldoc.CreateElement("message");
               message.InnerText = discussion.Text;
             
               parentelement.AppendChild(name);
               parentelement.AppendChild(message);
              
               xmldoc.DocumentElement.AppendChild(parentelement);
               xmldoc.Save(Server.MapPath("Sample.xml"));


same i need to achive using jquery or javascript how can i do it...
Posted
Updated 24-Mar-15 20:18pm
v3
Comments
Sergey Alexandrovich Kryukov 25-Mar-15 2:26am    
JavaScript normally does not have access to files...
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900