document.execCommand(‘SaveAs’,’1’,’Name of the webpage.htm’);

less than 1 minute read


<P><FONT SIZE=2 FACE=”Arial”>function saveRiskReport()</FONT>
        <FONT SIZE=2 FACE=”Arial”>{</FONT>
                <FONT SIZE=2 FACE=”Arial”>var previewReportElement = $(‘previewReportDiv’);</FONT>
                <FONT SIZE=2 FACE=”Arial”>var html =  previewReportElement.innerHTML;</FONT> </P> <P>                <FONT SIZE=2 FACE=”Arial”>document.open("text/html","replace");</FONT>
                <FONT SIZE=2 FACE=”Arial”>document.write(html);</FONT>
                <FONT SIZE=2 FACE=”Arial”>document.close();</FONT> </P> <P>                <FONT SIZE=2 FACE=”Arial”>document.execCommand(‘SaveAs’,true,’filename.html’);</FONT>
        <FONT SIZE=2 FACE=”Arial”>}</FONT> </P> <P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">http://www.devpapers.com/article/83</FONT> </P> <P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">http://bytes.com/forum/thread752642.html</FONT> </P> <P>uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLDocument.execCommand]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://10.160.33.163:9080/RCMS/assessmentPreview.html :: saveRiskReport :: line 212" data: no] </P>
<P>uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLDocument.execCommand]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://10.160.33.163:9080/RCMS/assessmentPreview.html :: saveRiskReport :: line 218" data: no] </P>

Categories:

Updated:

Leave a Comment