报错信息:Uncaught ReferenceError: plus is not defined
页面代码如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<meta name="misapplication-tap-highlight" content="no"/>
<meta name="HandheldFriendly" content="true"/>
<meta name="MobileOptimized" content="320"/>
<title>Hello World</title>
<script type="text/javascript" charset="utf-8">
function plusReady () {
var self=plus.webview.currentWebview();
}
if (window.plus) {
plusReady();
}else{
document.addEventListener("plusready",plusReady(),false);
}
function openNewWebview () {
var url="http://m.csdn.net/";
plus.webview.create(url).show();
}
</script>
</head>
<body>
Hello World <br />
<button onclick="openNewWebview()">打开新页面</button>
</body>
</html>
carl_wang (作者)
您好,
我改成document.addEventListener("plusready",plusReady,false);这个仍然是报同样的错
是不是不能在Chrome浏览器上运行呢?
2015-01-05 15:44
bxh201
测试看看是否可以评论
2015-01-05 20:08