页面内嵌套页面,可使用iframe实现
<!-- div_title start -->
<div class="div_content">
<iframe name="content_iframe" title="content_iframe" onload="hideIframeDiv()" class="content_iframe"
frameborder="0" scrolling="auto" src="m?xwl=mobile_yf/detectionByDoor/LifeDetection">
</iframe>
</div><!-- div_content start -->
js实现点击按钮切换iframe内的,路由切换:
点击切换按钮在上一遍文章http://t.csdn.cn/frAZz
function searchData(){
$('.next_btn').each(function(){
this.addEventListener("click",function(ev){
var id = this.id;
console.log(id);
if(id == 'shjy'){//生活检验
document.getElementsByName("content_iframe")[0].src = "m?xwl=mobile_yf/detectionByDoor/LifeDetection";
}else if(id == 'jyjc'){//基因检验
document.getElementsByName("content_iframe")[0].src = "m?xwl=mobile_yf/mPersonalCenter/mHealthService";
}
});
})
}
注:
document.getElementsByName("content_iframe")[0],
【0】主要是因为"content_iframe"是class不是id