Question

If I load an HTML from file:// and in the HTML there's an AJAX 'GET' request to a relative URL, it means the URL is pointing to a file and the file is loaded.

Can I have a similar behavior for 'PUT'? Meaning overwrite the file's content with the AJAX data?

I need this so I can easily debug scripts without the need to setup an HTTP server to host them and reply to the requested URLs.

Thank you

Was it helpful?

Solution

As far as I know, the HTML/script model in current browsers does not allow changing local resources (sort of a sandbox - think of the mess that would occur if an HTML page could write to a local file). The file:// is just a way to tell the browser a resource it's looking for is local to the machine it's running on, so it won't need to utilize the network. So you can read local resources from script - not change them.

Why not just run a local web server? You'll need it anyway eventually.

OTHER TIPS

I don't think so. Where would the data post to and what would process it?

ExtJs has full REST on Ajax calls. Using the "core" release is free.

Check out their online documentation : http://extjs.com/products/extcore/manual/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top