Welcome visitor
* Login
* Register
It is currently March 25th, 2019, 2:12 pm
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Client Side » HTML



Post new topic Reply to topic  [ 2 posts ] 
Author Message
  Get iframe location
PostPosted: October 2nd, 2009, 3:45 pm 

Posts: 31
I have two iframes on a site and i want to create a link or a button so when you click it the frames are swapped, can you help me with this script?

I've found this to get the location of the iframe current document but it doesnt work when the user has navigated away from my site into other domanins
alert(document.getElementById('lf').contentWindow.location.href);

Thanks for any help.


Top
 Profile  
 
  Re: Get iframe location
PostPosted: October 2nd, 2009, 5:25 pm 
User avatar

Posts: 70
and still you will not be able to do it for security purposes, only when the user is on your site.
hth
<script type="text/javascript">
function swappt(){
x=document.getElementById('lf').contentWindow.location.href;
y=document.getElementById('rg').contentWindow.location.href;
iframe1.location=y;
iframe2.location=x;}
</script>


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

FORUMS » Client Side » HTML


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron