Forum Moderators: open

Message Too Old, No Replies

Changing the source of an iframe

innerHTML, outerHTML, write ... HELP !

         

fmaz

1:39 am on Nov 26, 2004 (gmt 0)

10+ Year Member



ok, simple:

I've an iframe (again ;p)

When I hide it, I want the iframe source to be changed to :
<html><body bgcolor="#000000">Loading...</body></html>

So when I'll make it visible back with a new page to load inside, there will be a loading... message until the new page will start to load.

MY QUESTION: How can I change the source of an iframe?
I've tried:
document.getElementById("pjactionifrm").body.write = "Blabla"
document.getElementById("pjactionifrm").write = "Blabla"
document.getElementById("pjactionifrm").innerHTML = "Blabla"
document.getElementById("pjactionifrm").outerHTML = "Blabla"

Nothing seem to work...

Any solution?

kaled

10:22 am on Nov 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try the following (no promises)

document.getElementById("pjactionifrm").document.location.href =newurl;

Kaled.

fmaz

5:35 pm on Nov 26, 2004 (gmt 0)

10+ Year Member



The goal is to change the source without any loading...

document.getDocumentById("iframe").src =
also work, but I want to set some HTML code inside the iframe directly without any loading.