Save As Image Problem in Mozilla Firefox

Javascript coding ..

Moderators: egami, macek, gesf

Post Reply
sanketce
New php-forum User
New php-forum User
Posts: 90
Joined: Fri Dec 02, 2005 3:23 am

Wed Mar 22, 2006 2:55 am

Below code works correctly in IE but produces an error in IE what is wrong with this.

Code: Select all

function saveImageAs (imgOrURL) 
{

	if (typeof imgOrURL == 'object')
		imgOrURL = imgOrURL.src;
	//window.win = open (imgOrURL);
	setTimeout('window.document.execCommand("SaveAs")', 500);
}

<a href="#" onclick="saveImageAs(document.frm.anImage); return false;" class="bottom_text">Save Image</A>

sanketce
New php-forum User
New php-forum User
Posts: 90
Joined: Fri Dec 02, 2005 3:23 am

Wed Mar 22, 2006 2:57 am

Correction!!!!
Above code doesnt work in mozilla.

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2213
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Sat Apr 01, 2006 10:55 am

window.document.execCommand("SaveAs") is the problem im not sure that you willb e able to do that...
Best Regards,
Alexej Kubarev
-------------------------------
Zend Certified Engineer
Image Image

User avatar
gesf
Moderator
Moderator
Posts: 1716
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Sun Apr 02, 2006 4:56 pm

Try running execCommand outside the setTimeout. Or... put no timeout.
Sincerely,
Gonçalo "gesf" Fontoura

gesf.org | sessionstart.com | urlms.com

sanketce
New php-forum User
New php-forum User
Posts: 90
Joined: Fri Dec 02, 2005 3:23 am

Sun Apr 02, 2006 9:32 pm

I think execCommand("SaveAs") is not supported by Mozilla.... what is your view?

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2213
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Sun Apr 02, 2006 11:06 pm

pretty much what i thought.. however look at http://developer.mozilla.org as they have the documentation for everything that has to do with JS and Mozilla
Best Regards,
Alexej Kubarev
-------------------------------
Zend Certified Engineer
Image Image

sanketce
New php-forum User
New php-forum User
Posts: 90
Joined: Fri Dec 02, 2005 3:23 am

Mon Apr 03, 2006 12:24 am

Thanks for your suggestion :)

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests