Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 4.50 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-31-2008, 11:39 PM   PM User | #1
GameOn
New Coder

 
Join Date: Aug 2008
Posts: 12
Thanks: 2
Thanked 0 Times in 0 Posts
GameOn is an unknown quantity at this point
How to use JavaScript to read/write XML locally?

I have an html page installed on the client.
Also, I have an XML page installed on the client.
The user loads the html page to view the XML data in a browser (Firefox).

I am using JavaScript to read the XML file.

Now I would like the user to be able to add, edit or delete nodes from the XML file (creating a mini database that can be updated by the user).

Is this possible?
GameOn is offline   Reply With Quote
Old 09-01-2008, 04:58 PM   PM User | #2
Mikebert4
New Coder

 
Join Date: Jul 2008
Location: Peterborough - UK
Posts: 63
Thanks: 4
Thanked 9 Times in 9 Posts
Mikebert4 is on a distinguished road
My gut instinct is that this is only really possible with php, though I might well be wrong.

I've done somthing similar in the past and I wrote a simple php script that read the XML file and echoed out a javascript array of the data.

The client then uses/manipulates this data using Javascript.

Upon 'saving' the alterations made, the page posted the javascript array to another php script which wrote the changes to the XML file.

...A similar process might be your best bet (though if this is possible using JS, I'd love to know how!)
Mikebert4 is offline   Reply With Quote
Old 09-01-2008, 10:55 PM   PM User | #3
GameOn
New Coder

 
Join Date: Aug 2008
Posts: 12
Thanks: 2
Thanked 0 Times in 0 Posts
GameOn is an unknown quantity at this point
I hope it can be done in JS. The reason I am not using PHP is this is really not a web app. I am simply using the browser as the interface for the JS-powered database editor. So everything is run locally (no server involved = no PHP).
GameOn is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:03 AM.


Advertisement
Log in to turn off these ads.