Is it possible to create a copy variable of document in javascript?
As I am a C# developer I want something like
var doc=new document();
var doc = document;
doc.open('application/txt', 'replace');
doc.charset = 'utf-8';
doc.write('Message to write in txt file');
doc.close();
if (doc.execCommand('SaveAs', true,'test.txt')) {
alert(success);
}
I have one button and some other controls in the iframe popup where i want to open saveas dialog onclick of button. After i run the above code ‘Message to write in txt file’ is showing in the page where i have my button and other controls
I have resolved this issue like below. I have added a iframe in my page and did the below.