2
我想测试基于答案的连接在Detect if Firebase connection is lost/regained测试火力点连接连接
我想:
var testRef=new Firebase('https://flickering-heat-528.firebaseio.com/test');
testRef.child('.info/connected').on('value', function(connectedSnap) {
if (connectedSnap.val() === true) {
alert('* we\'re connected! *');
} else {
alert('* we\'re disconnected! *');
}
});
,但我得到:未捕获的错误:Firebase.child失败:第一个参数是无效路径:“.info/connected”。路径必须是非空字符串,不能包含“。”,“#”,“$”,“[”或“]”
有什么不对?
[新火力地堡的可能的复制失败:第一个参数必须是有效的火力点URL和路径不能含有”。 “,”#“,”$“,”\ [“或”\]“](http://stackoverflow.com/questions/31518707/new-firebase-failed-first-argument-must-bea-a- valid-firebase-url-and-the-path-ca) –