Skip to content

Instantly share code, notes, and snippets.

@hainuo
Created May 13, 2019 07:45
Show Gist options
  • Save hainuo/9da6a715e35e1e99d516477ac2f5ff60 to your computer and use it in GitHub Desktop.
Save hainuo/9da6a715e35e1e99d516477ac2f5ff60 to your computer and use it in GitHub Desktop.
apicloud如何控制一个指向未知外部url的frame进行刷新
<style>
*{background: #fff}
</style>
<br>
<br>
<br>
<div onclick="reload()"> reload() </div>
<script>
apiready=function () {
alert('read');
api.openFrame({
name: 'page2',
url: 'http://www.baidu.com',
rect: {
x: 0,
y: 150,
w: 320,
h: 480
},
pageParam: {
name: 'test'
},
bounces: true,
bgColor: 'rgba(0,0,0,0)',
vScrollBarEnabled: true,
hScrollBarEnabled: true
});
}
function reload(){
var js = 'alert(\'reload later!\');window.location.reload()';
api.execScript({
frameName:"page2",
script: js
});
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment