First of all this is not a question about how can I use http client on server, it's more about JS.
I have a protected area on site (let say /myprotected/ ), all css and images are on it. I want to html post it all (let say /htmlconverter) . And on server side finally convert it to looks like offline page. Something like "save as" in browser.
Here is the code for html text only
var htmlelement = document.getElementById("html");
htmlelement.value = document.getElementById("source").innerHTML;
Is there a way to send all resources including img and css to server?
For css I will try to AJAX call the css source and add response as a text to a new post.
以上就是"save as" html on server side的详细内容，更多请关注web前端其它相关文章！