我正在尝试实现和测试这段代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum- scale=1.0">
<meta name="description" content="Tizen basic template generated by Tizen Web IDE"/>
<title>Tizen Web IDE - Tizen - Tizen basic Application</title>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
<script src="js/main.js"></script>
<script src="js/annyang.min.js"></script>
<script>
window.onload = function(){
/* if (annyang) {
var commands = {
'Good': function() {
alert('Hi! I can hear you.');
}
};
annyang.addCommands(commands);
annyang.start();
}*/
if (annyang) {
console.log("Enter");
// Let's define a command.
var commands = {
'ok watch': function() { alert("My alert"); }
};
annyang.debug();
// Add our commands to annyang
annyang.addCommands(commands);
// Start listening.
annyang.start();
}
else {
alert("Error alert");
}
}
</script>
</head>
<body>
</body>
</html>
问题是这段代码在 Tizen 网络模拟器上运行良好,但在 Tizen 模拟器中我得到了这个错误(“我的警报”)。
怎么了?提前致谢。