/ Published in: JavaScript

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<html> <head> <script type="text/javascript"> <!-- function getImage(pExistingImageID, pImageURL){ var img = document.createElement('img'); img.onload = function (evt) { document.getElementById(pExistingImageID).src=this.src; document.getElementById(pExistingImageID).width=this.width; document.getElementById(pExistingImageID).height=this.height; } img.src = pImageURL; return false; } //--> </script> <title>Remote Image 5</title> </head> <body> <p><a href="#" onclick="return getImage('placeHolder','/images/rdivilbiss.jpg');">Get Remote Image</a></p> <p><img id="placeHolder" border="0" src="/images/placeHolder.jpg"></p> </body> </html>
URL: http://www.rodsdot.com/ee/scriptingRemoteImages.asp
Comments
