Is it possible to add elements to an xml file permanently using javascript?

by admin on May.02, 2010, under Javascript

I am using the examples on w3schools and as far as i can tell creating or adding an element with javascript only makes that element accessible through javascript. I want to actually write a new element in to my XML file. How can i do this?

:, , , , ,

2 Comments for this entry

  • Calvin K

    Javascripts don’t have access to files, Period.
    You can’t write to a file using javascript.

    But there are some workaround.
    You can use XMLHttpRequest object(Ajax) or
    You can use filesystem object in Windows Scripting Host or Internet Explorer in a trusted environment.

    http://www.javascripter.net/faq/fileacce.htm

  • meander365

    You’ll need some kind of server side language (ASP,PHP) to perform this for you.

    Write a small piece of server side code that accepts parameters and which then performs your permanent change to your xml file. Call the .asp or .php file using an ajax request in javascript.

Leave a Reply

BHBodeezy.com

I hope you like the site :)

Please enjoy, and let us know if you have any suggestions, feedback or need any help. Thanks!