javascript - how to redirect inside of iframe location to another location? - Stack Overflow

How can i redirect a I-frame location to another location?any idea?i have this kind of sample what I&

How can i redirect a I-frame location to another location? any idea? i have this kind of sample what I'm trying to do

I want this location to another one by click button inside of that site. when this site is logged in then when i pressed log out button I want to e back on this page but still in this I-frame.

How this is possible?

HTML

  <iframe scrolling="no" src="">
  </iframe>

How can i redirect a I-frame location to another location? any idea? i have this kind of sample what I'm trying to do

I want this location to another one by click button inside of that site. when this site is logged in then when i pressed log out button I want to e back on this page but still in this I-frame.

How this is possible?

HTML

  <iframe scrolling="no" src="http://www.example./login">
  </iframe>
Share asked Sep 9, 2013 at 17:39 user2579060user2579060
Add a ment  | 

2 Answers 2

Reset to default 5

Give an id to your iframe

<iframe scrolling="no" src="http://www.example./login" id ="myframe">
</iframe>

then on your button click

var frame = document.getElementById('myframe');
 frame.src = "your new src";
function DoubleOpen(site1, site2) {
var site2=site2;
document.getElementById("frame").src=site1;
setTimeout(function() { loadSite(site2); },4000);
} 

function loadSite(site2){
document.getElementById("frame").src=site2;
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744930191a4601688.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信