• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

newbie: xmlhttprequest writes?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all, sorry if this is very obvious.

I'm playing around with dhtml/javascript before a jsp project to get the feel of things.

using the built-in apache web server on my mac:

I have a very simple form that when loaded, reads some data from a xml file via xmlhttprequest and displays it - this works ok.

What i would like to do is take a piece of info the user has entered into a form field and _save_ it to a _new_ xml file.

I thought i could do something like this.

but this doesn't work. if the file exists the alert returns nothing and nothing is added to the file. if the file does not exist (which is what i would want, i get failure code 0x800004005).

Presumably i'm doing something fundamentally wrong here but am not sure what way i should do it.

Any thoughts?

TIA.

bg
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An XML file is a passive entity - it can be read, but it can't be written to from a browser. You need an active server-side component (like a servlet) that you can POST to with the new file contents and which then uses file I/O to alter the file.
reply
    Bookmark Topic Watch Topic
  • New Topic