Created
May 13, 2019 07:45
-
-
Save hainuo/9da6a715e35e1e99d516477ac2f5ff60 to your computer and use it in GitHub Desktop.
apicloud如何控制一个指向未知外部url的frame进行刷新
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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