iframe——html子页面调用父页面的方法
$( function () {
//在iframe子页面中查找父页面元素
alert($( ‘#default’ , window.parent.document).html());
//在iframe中调用父页面中定义的变量
alert(parent.value);
//在iframe中调用父页面中定义的方法
parent.sayhello();
//在iframe中进行跳转页面
parent.location.href=”/home/login”;
});
还没有评论,来说两句吧...