473,396 Members | 2,121 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

javascript onclick "save as" - firefox

Hi,

Is there a way to get a script function to save a page without the
execCommand (which works on IE but doesn't on Firefox).

Below there's the code I'm using, I took it from a template page and
added the save as command... all the functions are doing well within
the two browsers except the "save as" on Firefox.

<p>
<input class="eebuttons" type="button" value="Calcular"
name="bot_calculate" onclick="recalc_onclick('')">
<input class="eebuttons" type="button" value="Apagar" name="bot_reset"
onclick="reset_onclick('')">
<input class="eebuttons" style="margin-left:30px" type="button"
value="Gravar" name="bot_save"
onclick="document.execCommand('SaveAs');">
<input class="eebuttons" type="button" value="Imprimir"
name="bot_print" onclick="window.print();">
</p>

Please be aware that I'm a javascript noob.

Thanks in advance.

Nov 4 '08 #1
2 11123
ejrfigueiredo wrote:
Is there a way to get a script function to save a page without the
execCommand (which works on IE but doesn't on Firefox).
Not from within the sandbox, I presume; that would be a security leak.
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Nov 4 '08 #2
On Tue, 4 Nov 2008 03:54:39 -0800 (PST), ejrfigueiredo
<ej***********@gmail.comwrote:
>Hi,

Is there a way to get a script function to save a page without the
execCommand (which works on IE but doesn't on Firefox).

Below there's the code I'm using, I took it from a template page and
added the save as command... all the functions are doing well within
the two browsers except the "save as" on Firefox.

<p>
<input class="eebuttons" type="button" value="Calcular"
name="bot_calculate" onclick="recalc_onclick('')">
<input class="eebuttons" type="button" value="Apagar" name="bot_reset"
onclick="reset_onclick('')">
<input class="eebuttons" style="margin-left:30px" type="button"
value="Gravar" name="bot_save"
onclick="document.execCommand('SaveAs');">
<input class="eebuttons" type="button" value="Imprimir"
name="bot_print" onclick="window.print();">
</p>

Please be aware that I'm a javascript noob.

Thanks in advance.

Many things work only in IE because M$ has made it that way.
Nov 5 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
by: Curious Angel | last post by:
I have a resume in PDF format and I want anyone who LEFT-OR-RIGHT clicks the link to force the file to be saved, and in any event _not_ opened. Since the PDF will be in his cache in any event, I...
4
by: Richard | last post by:
Hi I'm new to ASP/Web programming so any help would be appreciated... Situation: On my web page I would like to present a link {or button} that would allow the user to download a large file. ...
2
by: jain_tj | last post by:
Could anyone please help me with the following problem My xml file is ============== <fig id="F0000001"> <caption>Caption text</caption> <image id="I0000001" image.class="halftone"...
2
by: Sound | last post by:
Enter space bar for field names and save the field.The field shoud not get saved and an alert should be there as"Space bars are not allowed" Add a field without giving any name and save the...
60
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I prompt a "Save As" dialog for an accepted mime type?...
1
by: craigslist.jg | last post by:
Hi, I've built a client side webpage for our internal users, which when loaded, generates some HTML within an iFrame. The HTML generated to the iFrame is then saved as HTML. I know it's useless...
1
by: deerchao | last post by:
I used these codes to provide a default "Save As" filename for browsers: Response.AppendHeader("Content-Disposition", "attachment; filename=" + fileName); Response.ContentType =...
1
by: COHENMARVIN | last post by:
I have a asp.net page that does something simple - when the user clicks on a radiobutton, a panel becomes visible beneath the radio button. There is some text below the radio button, and that is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.