change src of iframe before it loads

O

ofir

I have a page with iframe that i can only reach to it's attached .js
file.
i'm trying to change the src of the iframe but the only this i found
is:
document.attachEvent("onreadystatechange",startup)
function startup()
{
try{
var iframes = document.getElementsByTagName("IFRAME");
iframes(0).src = "http://www.blablabla.com";
catch(e){}
}

it worked but only after it allready loads the content of the iframe
so it first loads the original src and then my new one.
can I attach to an event that run before the original src loads into
the iframe?

thanks,
 
O

ofir

the .js is attached to the parent document.
and about what you said "something smells rotten", it isn't. this is
an application that gave me control only on that .js but the page it
self and the iframe page are from code behind. that's it
 
O

ofir

the js file is in the parent document. and about what you said
"something smells rotten" you wrong. this is an application that
allows me to change the js file only but the other content comes from
code behind(the parent html and the iframe html)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top