Is possible to create and download as .html file using jquery/javascript?
If not, is any third party website API available?
Because I planed to create a prototype maker through in blogger.com.
There I can write only client side program.
Is possible to create and download as .html file using jquery/javascript?
If not, is any third party website API available?
Because I planed to create a prototype maker through in blogger.com.
There I can write only client side program.
You can try this may help you.
<div id="test">
<span>testing</span>
</div>
(function(){
document.location =
'data:text/attachment;,' + //here is the trick
document.getElementById('test').innerHTML;
//document.documentElement.innerHTML; //To Download Entire Html Source
})();
You can also use html5
<a href="javascript:$('#test').html();" download="Filename">Download Div</a>
Have you tried the $http.get method? That should return a html page (or anything else for that matter). You haven't really said what you want to do with it though...