Online Shopping : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to
Did You Find This Entry Useful?

71 of 115 people (62%) answered Yes
Recently 5 of 10 people (50%) answered Yes


how to i invoke 'save as' dialog box on click instead of displaying it on the current page

Apr 6th, 2008 19:47
ha mo, Colin Fraser, Shyam Reddy,

Yuor question is really poorly asked, I just do not understand what you
mean by saying : 
    instead of displaying it on the current page
Do you want to save a file that is different than the page you are
viewing?  Then if so, try this : 
function saveFile (fname)
You can use a button 
<input type="button" value="Save" onClick="saveFile('otherpage.txt');">
or text
<a href="javascript:null()" onClick="saveFile('otherpage.txt');">Save
However, please recognise that what you are doing is to usurp the role
of the browser, while such things will work in many browsers, it will
not in others. So, why reinvent the wheel?