Click here to Skip to main content
15,906,766 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all
i need to paste an image while i have it url in an iframe on the click event of that image using javascript.

How can i do that, pleaseeee

Thanks
Posted
Updated 17-Jan-12 1:40am
v2
Comments
Sergey Alexandrovich Kryukov 17-Jan-12 12:52pm    
Any particular reason to use iframe for that? The content of iframe is like a separate page. All what happens on this page is controlled by the script on this page, not the page hosting iframe.
--SA
moon2011 17-Jan-12 13:35pm    
and what about chatting??? i have an iframe to enter in it chat emotions and send it.

1 solution

HTML
<iframe src="" id="MyIFrame" />

JavaScript
var iFrame = document.getElementById("MyIFrame");
iFrame.src = "http://codeproject.com";
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900