点击当前页面刷新子页面(框架)

用法:

onclick="document.getElementById('preview-iframe').contentWindow.location.reload(true);"

例子:

<!DOCTYPE html>
<html lang="zh-cn">
<head>
<title>刷新子页面</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
</head>
<body>
<div class="site-view">
<iframe src="http://www.baidu.com" frameborder="0" width="320" height="568" scrolling="no" id="preview-iframe"></iframe>
<span onclick="document.getElementById('preview-iframe').contentWindow.location.reload(true);">预览刷新</span>
</div>
</body>
</html>

猜你喜欢

转载自www.cnblogs.com/wangyongx/p/9443486.html
今日推荐