Board index   FAQ   Search  
Register  Login
Board index php forum :: HTML JavaScript

Save As Image Problem in Mozilla Firefox

Javascript coding ..

Moderators: macek, egami, gesf

Save As Image Problem in Mozilla Firefox

Postby sanketce » 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

Postby sanketce » Wed Mar 22, 2006 2:57 am

Correction!!!!
Above code doesnt work in mozilla.
sanketce
New php-forum User
New php-forum User
 
Posts: 90
Joined: Fri Dec 02, 2005 3:23 am

Postby Alexej Kubarev » 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...
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby gesf » Sun Apr 02, 2006 4:56 pm

Try running execCommand outside the setTimeout. Or... put no timeout.
User avatar
gesf
Moderator
Moderator
 
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden

Postby sanketce » Sun Apr 02, 2006 9:32 pm

I think execCommand("SaveAs") is not supported by Mozilla.... what is your view?
sanketce
New php-forum User
New php-forum User
 
Posts: 90
Joined: Fri Dec 02, 2005 3:23 am

Postby Alexej Kubarev » 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
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby sanketce » Mon Apr 03, 2006 12:24 am

Thanks for your suggestion :)
sanketce
New php-forum User
New php-forum User
 
Posts: 90
Joined: Fri Dec 02, 2005 3:23 am


Return to JavaScript

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron