我通过从我创建的本地 HTML 调用数据库来尝试我的 Firebase 测试版邀请。这是拒绝工作的代码。
<html>
<head>
<script src="https://static.firebase.com/v0/firebase.js"></script>
<script type="text/javascript">
var myDataReference;
function call_on_click() {
alert("Done!");
try {
myDataReference = new Firebase('https://sbose78.firebaseio.com/');
myDataReference.set('I am now writing data into Firebase!');
} catch (e) {
}
}
</script>
</head>
<body>
<input type="button" value="push me" onclick="call_on_click()">
</body>
</html>
我在 Ubuntu 上使用 Firefox 11。
[02:40:58.766] Firebase is not defined @ file:///root/Desktop/firebase-app1.html:20
--
[02:43:28.743] file:///root/Desktop/firebase-app1.html
[02:43:28.796] GET https://static.firebase.com/v0/firebase.js [HTTP/1.1 200 OK 1766ms]
[02:43:30.572] uncaught exception: [Exception... "Operation is not supported" code: "9" nsresult: "0x80530009 (NS_ERROR_DOM_NOT_SUPPORTED_ERR)" location: "https://static.firebase.com/v0/firebase.js Line: 28"]
我错过了什么?
提前致谢!