未捕获的 ReferenceError:Firebase 未定义 [英] Uncaught ReferenceError: Firebase is not defined

查看:28
本文介绍了未捕获的 ReferenceError:Firebase 未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试按照有关在 firebase 中设计数据库的教程进行操作,但在 JavaScript 控制台中出现以下错误:

I am trying to follow the tutorial on designing a database in firebase, but I am getting the following error in the JavaScript console:

未捕获的 ReferenceError:Firebase 未定义

Uncaught ReferenceError: Firebase is not defined

这是教程的链接,我试图在 JavaScript 控制台中运行的代码片段是:https://www.firebase.com/blog/2014-11-04-firebase-realtime-queries.html

Here is the link to the tutorial, and the code snippet that I was trying to run in the JavaScript console is: https://www.firebase.com/blog/2014-11-04-firebase-realtime-queries.html

var ref = new Firebase("https://dinosaur-facts.firebaseio.com/dinosaurs");
ref.orderByChild("height").on("child_added", function(snapshot) {
  console.log(snapshot.key() + " was " + snapshot.val().height + " meters tall");
});

推荐答案

在标题中,包括以下内容:

In the heading, include the following:

<head>
    <script src='https://cdn.firebase.com/js/client/2.2.1/firebase.js'></script>
    <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'></script>
    <link rel='stylesheet' type='text/css' href='/resources/tutorial/css/example.css'>
  </head>

这样就可以解决问题了.

That'll solve the problem.

这篇关于未捕获的 ReferenceError:Firebase 未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆