Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/395.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript &引用;“未定义Firebase”;错误_Javascript_Html_Dom_Firebase - Fatal编程技术网

Javascript &引用;“未定义Firebase”;错误

Javascript &引用;“未定义Firebase”;错误,javascript,html,dom,firebase,Javascript,Html,Dom,Firebase,我通过从我创建的本地HTML调用db来尝试Firebase beta邀请。 这是拒绝工作的代码 <html> <head> <script src="https://static.firebase.com/v0/firebase.js"></script> <script type="text/javascript"> var myDataReference;

我通过从我创建的本地HTML调用db来尝试Firebase beta邀请。 这是拒绝工作的代码

<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>
我错过了什么


提前谢谢

据我所知,这是一个问题。如上述文件所述:

从Gecko1.9开始,文件只允许读取某些其他文件。具体地说,只有当源文件的父目录是目标文件的祖先目录时,文件才能读取另一个文件。但是,目录不能以这种方式加载

例如,如果您有一个访问另一个文件bar.html的文件foo.html,并且您已从index.html文件导航到该文件,则仅当bar.html与index.html位于同一目录中或与index.html位于同一目录中时,加载才会成功


这是Firebase JavaScript客户端中的一个bug,它是由Firefox在从文件加载内容时处理sessionStorage引起的。应该在这一点上进行修正


再试一试,它就会工作。

你的机器上真的在运行Web服务器吗?不,我没有。对不起,我需要吗?据我所知,你需要。我没有遇到您的代码的任何问题;我目前正在使用xampp。不过,我把这封信注释掉了。试着把这封信保留一次,然后再回复?只是想看看数据的变化。@charlietfl我看到你改变了回复。谢谢你收回侮辱。它在民事讨论中没有一席之地。
[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"]