HTML:javascript
<body>
<form id="form1" runat="server">
<div>html
<div class="text-tabs">/*導航欄*/java
<a class="text-tab" data-target="/" href="javascript:void(0);" onclick="skipto(this);"><span>首頁</span></a>this
</div>spa
<div id="login" style=" width:200px; height:400px; float:left;">default.aspx</div>
<iframe src="/head.html?parame=head_introduce" frameBorder="0" width="100%" scrolling="no" height="61px"></iframe>orm
</div>
</form>
</body>server
JQ:htm
$(function() {
//在iframe中查找父頁面元素
alert($('#default', window.parent.document).html());
//在iframe中調用父頁面中定義的方法
parent.getHelloWorld();
//在iframe中調用父頁面中定義的變量
alert(parent.hello);token
//從父頁面中打開網頁ip
parent.location.href = '/index.html';
var login = request('login');
var token = request('access_token');
var parame = request('parame');
function skipto(obj){
if(token!=''){
parent.location.href=$(obj).attr('data-target')+'?login=' + login + '&access_token=' + token + '';
}
else{
parent.location.href=$(obj).attr('data-target');
}
}
});</script>