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

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

问题描述

我试图在firebase中设计一个数据库的教程,但是在JavaScript控制台中出现以下错误:


未捕获的ReferenceError:未定义Firebase


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

  var ref = new Firebase(https:/ /dinosaur-facts.firebaseio.com/dinosaurs); (child_added,function(snapshot){
console.log(snapshot.key()+was+ snapshot.val()。height + 米高);
});


解决方案

在标题中包含以下内容:



 < 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>  



这将解决问题。 / p>

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

Uncaught ReferenceError: Firebase is not defined

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天全站免登陆