Sign in to follow this  
johnnyBravo

[web] Possible to save xml file using javascript/html?

Recommended Posts

evolutional    1393
javascript probably isn't up to this task without some form of extension system on the client browser. The best thing for doing this is the use of server-side scripting components, do you have this option available to you?

Share this post


Link to post
Share on other sites
markr    1692
In some web browsers there exists an object which can be used to send HTTP requests to a server (independently of any page loading happening).

This is typically called XMLHttpRequest, and was originated by Microsoft. Mozilla has supported it for a while now and there are possibly some other browsers which do (Newer Opera and KHTML based browsers (Safari, Konqueror))

The exact method for creating this is slightly platform dependent. On IE on Win32, you need to use new ActiveXObject(somethingorother).

On most others, new XMLHttpRequest() should suffice.

Anyway, you can use this to send HTTP requests containing XML (or anything else, as it happens), and get the results back (in XML or anything else).

This can be used by client-side javascript to make server requests.

HOWEVER it only works if the server is the same as the page was loaded from that the scripts are in. This is an important security feature.

You can use it to load/save things from a web page which is driven by client scripts (for instance a high score table).

Mark

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this