Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: saving xml in javascript >Thread Next - Re: saving xml in javascript Re: saving xml in javascriptTo: NULL Date: 3/4/2007 2:10:00 PM
On Mar 3, 11:30 pm, unbewusst.s...@google.com.invalid (Une B=E9vue)
wrote:
> RickH <passp...@windcrestsoftware.com> wrote:
>
> > > It is not possible, by JavaScript policy, to save a document in the
> > > client side.
>
> > This is only true if your web page is being served by a web server.
> > If the web page is a local file on a hard drive that you have rights
> > to, then the save method works. I use it all the time to write
> > browser-based applications that dont require a web server to exist on
> > the users machine. They just click a local html file fill out the
> > form and save away.
>
> right !
>
> are you able to do that saving of a file with JavaSCript , which code ?
>
> i do have an application for that :
>
> the user select an area on the browser window and the javascript save
> that part locally, usefull, for example when u read an article online
> and want to avoid saving pub.
> --
> Une B=E9vue
Actually, I'm wrong, you're correct about pure javascript. I've been
using the Micosoft ActiveX XMLDOM not the java XMLDOM, but my code is
still javascript. Here is the object I use:
locXML =3D new ActiveXObject("Msxml2.FreeThreadedDOMDocument.5.0")
//locXML =3D new ActiveXObject("Msxml2.FreeThreadedDOMDocument.4.0")
//locXML =3D new ActiveXObject("Msxml2.FreeThreadedDOMDocument.3.0")
//locXML =3D new ActiveXObject("MSXML2.DOMDocument.5.0")
//locXML =3D new ActiveXObject("MSXML2.DOMDocument.4.0")
//locXML =3D new ActiveXObject("MSXML2.DOMDocument.3.0")
if (typeof(locXML) =3D=3D 'undefined') {
alert('Error: you must have the XML DOM installed')
} else {
locXML.async =3D false
locXML.validateOnParse =3D true;
locXML.resolveExternals =3D true;
locXML.setProperty("SelectionLanguage", "XPath");
}
locXML.load(my file name)
locXML.save(my file name)
Sorry about the confusion, you do need activeX.
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
