代码拉取完成,页面将自动刷新
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<title>Hello APICloud</title>
<link rel="stylesheet" type="text/css" href="./css/api.css" />
<link rel="stylesheet" type="text/css" href="./css/common.css" />
<style>
.center{
display:-webkit-box;
-webkit-box-orient:vertical;
-webkit-box-pack:center;
-webkit-box-align:center;
}
</style>
</head>
<body style='background:#EDEDED;'>
<div id="wrap">
<div id="main" class='center'>
<img id='loading' src='image/loading.gif' width=65 height=65>
</div>
</div>
</body>
<script type="text/javascript" src="./script/api.js"></script>
<script type="text/javascript">
var launchRemoved = false;
var loadingRemoved = false;
apiready = function(){
api.setStatusBarStyle({
style: 'light'
});
api.openFrame({
name: 'main',
url: 'http://43.128.47.87:8082/',
bounces: false,
allowEdit:true,
rect: {
w: 'auto',
h: 'auto'
},
progress:{
type:'page'
}
});
api.setFrameClient({
frameName:'main'
},function(ret){
onBrowserStateChange(ret);
});
removeLogic();
api.addEventListener({
name: 'keyback'
}, function(ret, err){
api.historyBack({
frameName:'main'
},function(ret,err){
if(!ret.status){
api.closeWidget();
}
});
});
removeLogic();
};
function onBrowserStateChange(ret){
if(0 == ret.state){//开始加载
if(!launchRemoved){
launchRemoved = true;
removeLaunch();
}
}
if(2 == ret.state){
if(!loadingRemoved){
loadingRemoved = true;
document.getElementById('loading').style.display = 'none';
}
}
}
function removeLogic(){
setTimeout(function(){
if(!launchRemoved){
launchRemoved = true;
removeLaunch();
}
}, 3000);
}
function removeLaunch(){
api.removeLaunchView({
animation:{
type:"fade",
subType:"from_right",
duration:300
}
});
}
</script>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。