473,809 Members | 2,940 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="eebutton s" type="button" value="Calcular "
name="bot_calcu late" onclick="recalc _onclick('')">
<input class="eebutton s" type="button" value="Apagar" name="bot_reset "
onclick="reset_ onclick('')">
<input class="eebutton s" style="margin-left:30px" type="button"
value="Gravar" name="bot_save"
onclick="docume nt.execCommand( 'SaveAs');">
<input class="eebutton s" 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 11152
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="eebutton s" type="button" value="Calcular "
name="bot_calc ulate" onclick="recalc _onclick('')">
<input class="eebutton s" type="button" value="Apagar" name="bot_reset "
onclick="reset _onclick('')">
<input class="eebutton s" style="margin-left:30px" type="button"
value="Grava r" name="bot_save"
onclick="docum ent.execCommand ('SaveAs');">
<input class="eebutton s" type="button" value="Imprimir "
name="bot_prin t" 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
5095
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 would just as soon place the employer in control of what directory he wishes to save it in, and there are two salient reasons for this: 1. I want him to OWN the document 2. I want him to FIND the document, quickly, on his hard drive In any...
4
5569
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. When the user clicks to start the download I would like to display the "Save As" dialog, allow the user to name a place to save the file, and then show the download progress bar while the file downloads Question: How do I make a windows "Save...
2
1485
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" image.type="jpg" print="0" width="29-6" depth="23-6" pointer="I0000001.jpg"/> </fig>
2
1826
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 field.The field should not get saved,and an alert should be there as "Field name is mandatory"
60
8032
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I prompt a "Save As" dialog for an accepted mime type? ----------------------------------------------------------------------- It is not possible with client-side JavaScript. Some browsers accept the Content-Disposition header, but this must be added by the server. Taking the form:- ` Content-Disposition: attachment; filename=filename.ext `
1
2463
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 to disable the Save As command, but can I at least intercept when they select this from the menu and display a message? Thanks
1
4438
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 = "application/octet-stream"; But if there are space chars in the file name, FireFox would split the recommed file name, and use the first part only. For example, if fileName=="aaa bbb.watever", then the "Save As" dialog will take "aaa"
1
260
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 displaced downward when the panel appears. This is what I intended. However, this only works in IE6. I find that in IE7, the panel appears, but it appears right on top of the text that should be displaced to a lower position on the page. So the...
0
9603
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10378
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9200
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4333
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3862
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.