I want to allow users to easily save text on one of our pages to their desktop as a text file. I have a button which calls this function when clicked:
var formName = button.form.name;
if (formName == "form_step_email_invite_text_initial")
else if (formName == "form_step_email_invite_text_reminder")
else if (formName == "form_step_email_invite_text_last")
Works like a charm in IE. But not in Firefox (I'm using v1.0.4). Throws this exception:
Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLDocument.execCommand]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: [URL] :: saveAsMe :: line 224" data: no]
Does firefox not support document.execCommand()? Is there another method for allowing the user to save the text of a page to the file name and location of their choosing?
Thanks for your help.