Skip to main content
gamedev.net
🔒 Locked

XML & Javascript

Started by Brocketino Mar 19, 2005 at 4:17 PM 0 replies 600+ views
Original Post
Brocketino
Brocketino
Is there a way to update a xml file from a &#106avascript or must i use PHP or ASP?
markr
markr
Err, yes and no.

&#106avascript running inside the web browser on the client side normally has no permission to read or write any local files.

There are ways which it can gain this permission, but that requires various browser-specific techniques to run privileged &#106avascript, and it's probably not what you want.<br><br>You *CAN* however, using client-side &#106avascript send a file to a web server where it will presumably be saved by some server-side script, &#111;n its behalf.<br><br>That file *COULD* be XML. Client-side script has the capability to manipulate XML DOMs for documents other than the current page - this is typically achieved by either creating a brand new document using something like document.implementation.createDocument() or loading a document from an existing file, either using the load method &#111;n that class or using XMLHttpRequest to get it from a server.<br><br>To post data back to a server, you would either put it into a form which would then be submitted, or send it using XMLHttpRequest.<br><br>All of these methods have some browser-specific issues, but should work at least in some fashion using IE6 and Mozilla.<br><br>Mark

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.