Download Word Document Using Javascript
Because i want javascript to download the file from server not anything else.
Download word document using javascript. Instead i want to open the downlo. This way of making javascript download files allows users to retrieve the content provided in the text area. The example code converts the html content to microsoft word document and it can be saved as a doc file. The encodeuricomponent function then encodes the content. The export2doc function converts html content to word or export specific part of a web page with images and download as doc file doc.
But i cannot use window href method since it replaces the current page contents with the file you re trying to download. There is a client side option for exporting html to a word document using javascript. I need to start download manually when a someid click. The declared function sets a download attribute where you get to name the file. Client side export to doc features makes the web application easy to use.
The issue is actually that after the downloading is done i want to get a status that downloading is done which is not fulfilling from above methods as window open doesn t have any return type. The user can export a particular portion of the material of the web page without refreshing the site.