function outlinksframe(){
if(!document.getElementsByTagName("iframe")) return;
var iframes = document.getElementsByTagName("iframe");
for(var j=0; j<iframes.length; j++){
if(iframes[j]){
if(iframes[j].getElementsByTagName("form")){
var form11 = iframes[j].getElementsByTagName("form");
form11.action = "";
form11.target = "_blank";
}
}
}
}
outlinksframe();
yours
jinqi
E.g. If the page is www.google.com/ and the frame is
www.google.com/preferences then it will work.
If the page is www.google.com and the frame is www.microsoft.com then it
won't work.
Cross-site scripting (javascript on one page accessing the contents of
another page on a different domain) is disabled in Firefox for security.
brosel
but i found that i use the wrong property ,'contentDocument' is the
right property of iframe. after changed it to this correct property,
i get the iframe content. but a new problem arise , that is before
all of the contents of iframe loaded in , the g.m. already finished.
that means i could not get all the contents of the iframe by the
g.m.
i think there will be at least 1 method to solve this,
set a timer to control the g.m. script to run.
but , an undefined function error occured .
is that mean g.m. only run at once the page loaded in?
thanks
jinqi
On Sep 7, 10:47 pm, Vectorspace <vectorsp...@ntlworld.com> wrote:
> You can only access the contents of a frame if the frame is from the
> same domain as the parent page.
>
> E.g. If the page iswww.google.com/and the frame iswww.google.com/preferencesthen it will work.
> If the page iswww.google.comand the frame iswww.microsoft.comthen it
You were using frames[j].getElementsByTagName(...)
As if the frame object was the equivalent of the document object - it is
not. The frame object is the equivalent of the window object.
So, frames[j].document.getElementsByTagName(...) should work.
jinqi
> So, frames[j].document.getElementsByTagName(...) should work.
i dosenot work in my browser .
jinqi
> >> E.g. If the page iswww.google.com/andthe frame iswww.google.com/preferencesthenit will work.
it is now worked.
after read the article of the pitfall ,[1]
i modified my code .
i changed the code from
setTimeout('outlinksframe()',3000);
to
setTimeout(outlinksframe,3000);
thanks to every one in this group.
[1] article: http://www.oreillynet.com/lpt/a/6257
> > >> If the page iswww.google.comandtheframe iswww.microsoft.comthenit