HTML:

<body>
    <form >
       <div>

                 <div class="text-tabs">/*导航栏*/

                     <a class="text-tab" data-target="/" href="javascript:void(0);" onclick="skipto(this);"><span>首页</span></a>

                </div>

      </div>
    </form>
</body>

JQ:

 $(function() {
            //在iframe中查找父页面元素
            alert($('#default', window.parent.document).html());
            //在iframe中调用父页面中定义的方法
            parent.getHelloWorld();
            //在iframe中调用父页面中定义的变量
            alert(parent.hello);

          //从父页面中打开网页

           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>

相关文章: