Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-09-2004, 10:49 AM   PM User | #1
lilmizzvi0let
New to the CF scene

 
Join Date: Jul 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
lilmizzvi0let is an unknown quantity at this point
Exclamation Is it possible to have a script/link to copy an image?

I know of the script/link to copy the image url, but is it possible to copy the whole image? or save picture as? it would be so great if someone replied XD. ive been stuck on it forever.
lilmizzvi0let is offline   Reply With Quote
Old 07-09-2004, 11:41 AM   PM User | #2
Kor
Red Devil Mod


 
Kor's Avatar
 
Join Date: Apr 2003
Location: Bucharest, ROMANIA
Posts: 8,478
Thanks: 58
Thanked 379 Times in 375 Posts
Kor has a spectacular aura aboutKor has a spectacular aura about
Yes, using execCommand('SaveAs') method and a trick (a hidden iframe in which pictures are loaded - because execCommand('SaveAs') method works for entire HTML page only).

See exemple in attachment

NOTE: this is an only IE method !! There is no cross-browser methods for othjer browsers
Attached Files
File Type: zip ex.zip (23.6 KB, 254 views)
__________________
KOR
Offshore programming
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Kor is offline   Reply With Quote
Old 07-09-2004, 12:21 PM   PM User | #3
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
You can simplify the code like this:
Code:
function saveAs(a){
  top.frames[0].location.replace(a);
  top.frames[0].focus();
  setTimeout("top.frames[0].document.execCommand('SaveAs')",1);
}
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app
glenngv is offline   Reply With Quote
Old 07-09-2004, 01:26 PM   PM User | #4
Kor
Red Devil Mod


 
Kor's Avatar
 
Join Date: Apr 2003
Location: Bucharest, ROMANIA
Posts: 8,478
Thanks: 58
Thanked 379 Times in 375 Posts
Kor has a spectacular aura aboutKor has a spectacular aura about
Thumbs up

Yes Glenn, good ideea, tx!
__________________
KOR
Offshore programming
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Kor is offline   Reply With Quote
Old 07-09-2004, 08:35 PM   PM User | #5
lilmizzvi0let
New to the CF scene

 
Join Date: Jul 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
lilmizzvi0let is an unknown quantity at this point
tnx so0o much
lilmizzvi0let is offline   Reply With Quote
Old 07-10-2004, 06:07 AM   PM User | #6
lilmizzvi0let
New to the CF scene

 
Join Date: Jul 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
lilmizzvi0let is an unknown quantity at this point
Wait, can I ask a question??? Last one I promise XP. I just wanted to know how to make it so it only target one specific iframe? coz the image keeps appearing in my tag board lol XD. tnx.

well, if i use the one kor gave me, it kinda stuffs up. but if i use the one glenn gave me, it kinda goes in the taggy frame. is there a way i can fix this?

Last edited by lilmizzvi0let; 07-10-2004 at 06:11 AM..
lilmizzvi0let is offline   Reply With Quote
Old 07-10-2004, 06:32 AM   PM User | #7
lilmizzvi0let
New to the CF scene

 
Join Date: Jul 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
lilmizzvi0let is an unknown quantity at this point
Quote:
Originally Posted by lilmizzvi0let
Wait, can I ask a question??? Last one I promise XP. I just wanted to know how to make it so it only target one specific iframe? coz the image keeps appearing in my tag board lol XD. tnx.

well, if i use the one kor gave me, it kinda stuffs up. but if i use the one glenn gave me, it kinda goes in the taggy frame. is there a way i can fix this?
no worries, i think i fixed it...
lilmizzvi0let is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:15 PM.


Advertisement
Log in to turn off these ads.