PDA

View Full Version : JAVASCRIPT+iframes !!!! HELLLLP



AMDERBO
Mar 8th, 2007, 05:03 PM
Hi
i'm trying to make a script that opens a random link from a page contained in an iframe ( the redirection is done in the same page without popups ) ....a sort of random redirection
that's what i done :

<head></head><body>
<script>
<!--
function random_all(){
var myrandom=Math.round(Math.random()*(document.links.length-1))
window.location=top.frames['frame'].document.links.[myrandom].href
}
//-->
</script>


<a href="javascript:random_all()">Random Link</a>

<iframe name="frame" frameborder="0" vspace="0" hspace="0"

marginwidth="0" marginheight="0" width="100%" height="100%"

src="http://www.yahoo.com">

</iframe>
</body>

Thanks for your help

shyam
Mar 8th, 2007, 05:07 PM
not unless ur hosting on yahoo.com !!

you cannot accesss the contents of an iframe if its pointing to an external server