Mohamed Mansour's Personal Website
Articles
Comments on How to preload an IFrame
4 Replies: (add yours)
Jean Paul
2Hi,
It works perfectly to display text but I have tried several approaches to insert an image instead via the CreateObjectNode, and honestly can;t figure it out to work.
This is for a customer that has a map inside of an iframe, could you please point me out what I am missing to insert a gif image saying loading?
Thank you and kind regards,
JP
› Posted on August 5, 2010, 1:13 pm
m0
3JP, to create an image is pretty easy, basically you replace:
newElement.appendChild(document.createTextNode('Loading ...'));
with an image instead:
var imgElement = new Image();
imgElement.src = 'http://www.google.com/images/logo_sm.gif';
newElement.appendChild(imgElement);
That will show an image node instead of a text node (Loading).
-Mohamed
› Posted on August 5, 2010, 10:34 pm

lneely
1THANK YOU! This works wonderfully.
› Posted on June 27, 2010, 1:28 pm