首页 > 为什么button嵌入到iframe框架中后无法实现页面的跳转?

为什么button嵌入到iframe框架中后无法实现页面的跳转?

引入的是bootstrap框架
<link rel="stylesheet" type="text/css" href="../CSS/bootstrap.css"/>

<script type="text/javascript" src="../js/jquery-2.0.0.min.js" ></script>
<script type="text/javascript" src="../js/bootstrap.js" ></script>

下面的是button按钮
点击事件方式

    <input type="submit" class="btn btn-primary" onClick="window.location.href='assess.html';" value="评估完成" />
a标签方式
    <input type="submit" class="btn btn-primary" href="assess.html" value="评估完成" />

iframe框架

    <iframe  id="iframepage" width="100%" height="100%" scrolling="no" frameborder="0" name="iframepage" src="quick.html" onLoad="iFrameHeight()"  >

问题:在单独的页面button按钮是可以实现链接跳转页面的,但是一旦嵌入到这个iframe中后就无法实现页面跳转了,请大家帮忙解答一下,感激不尽!!


iframe里面跳转试试:window.location.replace(newUrl);


因为,嵌入了iframe当中相当于嵌入了一个新的网页(在网页中打开了一个新的小浏览器),和原网页根本没有关系。所以自然是没法跳转的~

【热门文章】
【热门文章】