faqts : Computers : Programming : Languages : JavaScript : Frames

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

16 of 63 people (25%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

How do I reference a frame so I can save it? Ive tried document.execCommand("SaveAs")...but that saves all of my frames. I want to save 'main' frame

Aug 25th, 2001 10:09
Tony Crosby, johnny knoxville,


Say you have a button called "save as"
<a href="http://">Save As</a>
 Take an iframe,
<iframe name="MiniFrame" width=1 height=1 marginwidth=0 marginheight=0 
hspace=0 vspace=0 frameborder=0 scrolling=no></iframe>
 And do something like this,
<a onclick="frames.MiniFrame.location.href='http://myMainPage.html'; 
frames.MiniFrame.document.execCommand('SaveAs'); return false;" 
href="http://">Save As</a>
 For a reference of things you can do with execCommand folks, go to 
MSDN.microsoft.com and click advanced search, remove all the check 
boxes from the scope and only select DHTML, Internet Explorer, and 
HTML. Then search for execCommand,
 I would give the url right to the page but since they move everything 
on there site as many times as they do the link would probably be dead 
tomorrow.
 Tony