[英]Firebase 3.6.2 Web SDK missing “use strict”
I was trying to get a web app up and running and followed a very straightforward tutorial from Firebase. 我试图启动并运行Web应用程序,并遵循Firebase的一个非常简单的教程。 The link is pasted as a comment below. 该链接被粘贴为下面的注释。
The webpage, upon being loaded in Google Chrome, does not behave according to the tutorial. 该网页在Google Chrome浏览器中加载后,按照该教程的操作无法正常运行。 You are supposed to be able to change the value at a location specified at the child node "text" of my Firebase database and the webpage ought to update the text of a to reflect the change of the database. 您应该能够在Firebase数据库的子节点“文本”中指定的位置更改值,并且网页应该更新a的文本以反映数据库的更改。 It doesn't. 没有。 Dreamweaver tells me I'm forgetting the "use strict"; Dreamweaver告诉我,我忘记了“严格使用”; line in Firebase.js Firebase.js中的一行
I was wondering if anybody had any idea why this was? 我想知道是否有人知道为什么会这样吗? I imagine I'm making an obvious mistake somewhere. 我想我在某个地方犯了一个明显的错误。
I've also included screenshots of the error and my source code. 我还提供了错误和我的源代码的屏幕截图。 I appreciate any help! 感谢您的帮助!
Thanks! 谢谢!
error from Firebase.js Firebase.js中的错误
my source code 我的源代码
Dreamweaver runs a linter on all code and the 'use strict' warning is a red herring for your problem. Dreamweaver在所有代码上运行linter,并且“使用严格”警告对您的问题是一个红色鲱鱼。 Code without 'use strict' isn't going to break anything so ignore it. 没有“严格使用”的代码不会破坏任何内容,因此请忽略它。 If you find the warning distracting, you can disable it in Dreamweaver. 如果发现警告分散了您的注意力,则可以在Dreamweaver中将其禁用。
Anyway, if something isn't working in your app, you should be checking for errors in your browser's console log. 无论如何,如果您的应用无法正常运行,则应检查浏览器的控制台日志中是否存在错误。
If your screenshot contains the entirety of your code, your problem might be that you're trying to set the innerText
of a non-existent element, bigOne
. 如果您的屏幕快照包含整个代码,则您的问题可能是您试图设置不存在的元素bigOne
的innerText
。 This would present in the console as an error like "cannot set property innerText of undefined". 这将在控制台中显示为错误,例如“无法设置未定义的属性innerText属性”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.