Articles

Navigation ( archives ›› 2010 ›› June ›› 10 ›› How to preload an IFrame ›› comments )

Comments on How to preload an IFrame

4 Replies: (add yours)

1

THANK YOU! This works wonderfully.

› Posted on June 27, 2010, 1:28 pm

2

Hi,

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

3

JP, 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

4

Mohamed,

Thank you for taking the time to respond to my question.

Sincerely, YOU ROCK BIG TIME!! It works like a charm now.

:)

› Posted on August 6, 2010, 12:41 am

Comment on This Article:

No HTML allowed, URIs will be auto-linked, line breaks converted to paragraphs - . Your email address will not show up on this page, I do not store addresses, nor will I give them awat. I hate spam too. (*) - Denotes Required fields!