<html>
<head>
<meta charset="UTF-8">
<title>test wilddog </title>
</head>
<body> JSON 数据树:
<p><input placeholder="说点什么?" data="{"m":"hi","n":"wgscd","t":"2018-11-12 11:13:13"}" class="s_txt" type="text" style="width:388px;
height: 34px;
border-radius: 3px;
border: 1px solid rgb(204, 204, 204);
padding-left: 10px;"/> <input type="button" value="add msg" class="addmsg"/> </p> <div class="d_show">
<!-- <div>text message</div> -->
</div> <script src = "https://cdn.wilddog.com/sdk/js/2.0.0/wilddog-auth.js"></script>
<script src = "https://cdn.wilddog.com/sdk/js/2.0.0/wilddog-sync.js"></script>
<script src="https://cdn.wilddog.com/js/vendor/jquery-1.11.2.min.js"></script> <script type="text/javascript"> $(document).ready(function() {
var config = {
authDomain:"m5mworld65.wilddog.com",
syncURL: "https://m5mworld65.wilddogio.com"
};
wilddog.initializeApp(config);
var ref = wilddog.sync().ref();
$(".addmsg").click(function() {
var text = $(".s_txt").val();
alert(text);
ref.child('msg').push(text);
$(".s_txt").val('');
}); ref.child('msg').on('child_added', function(snapshot) {
var text = snapshot.val(); var textObj = $("<div class=\"dm_message\"></div>");
textObj.text(text);
$(".d_show").append(textObj); });
}); </script> </body>
</html>

  

另外一个弹幕的例子:https://github.com/WildDogTeam/demo-js-danmu/blob/master/app/index.html

Wild Dog sample [sync data]的更多相关文章

  1. Sync Data to AWS S3 on Windows Box

    1. Install AWS CLI first, windows download link https://s3.amazonaws.com/aws-cli/AWSCLI64.msi 2. The ...

  2. [Hive - Tutorial] Data Units 数据存储单位

    Data Units In the order of granularity - Hive data is organized into: 数据库.表.分区.桶 Databases: Namespac ...

  3. [转]Data Structure Recovery using PIN and PyGraphviz

    Source:http://v0ids3curity.blogspot.com/2015/04/data-structure-recovery-using-pin-and.html --------- ...

  4. Sample Means(耶鲁大学教材)

    Sample Means The sample mean from a group of observations is an estimate of the population mean. Giv ...

  5. Data transfer from GPIO port to RAM buffer using DMA upon receiving a trigger signal on the timer capture input channel.

    Data transfer from GPIO port to RAM buffer using DMA upon receiving a trigger signal on the timer ca ...

  6. THE TOOLS TO MANAGE YOUR DATA ACROSS CLOUDS

    http://blog.grexit.com/manage-data-across-clouds/ That the average small business uses a cloud servi ...

  7. NTFS格式下的Alternate Data Streams

    今天我写点NTFS的交换数据流以及其带来的安全问题(Alternate Data Stream/ADS) =============================================== ...

  8. MVC---Case 1

    <!DOCTYPE html> <html lang="en"> <head> <title>Backbone.js, Requir ...

  9. Sphinx 2.2.11-release reference manual

    1. Introduction 1.1. About 1.2. Sphinx features 1.3. Where to get Sphinx 1.4. License 1.5. Credits 1 ...

随机推荐

  1. jQuery星级评论表单美化代码

    最近正在做php第二阶段的项目,由于我们小组做的是游戏评论网站,所以需要用到评分评论的页面,这里我做了个星级评论表单 1.首先,我们需要引入一个jQuery文件,代码如下: /*! * jQuery ...

  2. Android之在linux终端执行shell脚本直接打印当前运行app的日志

    1.问题 我们一般很多时候会需要在ubuntu终端上打印当前运行app的日志,我们一般常见的做法是 1).获取包名 打开当前运行的app,然后输入如下命令,然后在第一行TASK后面的就可以看到包名 a ...

  3. 几个python函数

    迭代器 fun函数 过滤作用 s=['a', 'b', 'c'] def fun1(s): if s!='a': return s ret filter(fun1, str) print(ret)   ...

  4. 《JavaScript面向对象编程指南》

    第一章.引言 1.5 面向对象的程序设计常用概念 对象(名词):是指"事物"在程序设计语言中的表现形式. 这里的事物可以是任何东西,我们可以看到它们具有某些明确特征,能执行某些动作 ...

  5. LeetCode题解之 Longest Common Prefix

    1.题目描述 2.问题分析 直接使用循环解决问题 3.代码 string longestCommonPrefix(vector<string>& strs) { string re ...

  6. python编写脚本

    #!/usr/bin/env python #-*- coding:utf-8 -*- import sys import os from subprocess import Popen,PIPE c ...

  7. visual studio 单元测试的认识

    单元测试(unit testing),对软件中的最小单元进行检查和验证,其一般验证对象是一个函数或者一个类. Team Test 是 Visual Studio 集成的单元测试框架,它支持: 测试方法 ...

  8. Azure 门户中基于角色的访问控制入门

    面向安全的公司应侧重于向员工提供他们所需的确切权限. 权限过多,可能会向攻击者公开帐户. 权限太少意味着员工无法有效地完成其工作. Azure 基于角色的访问控制 (RBAC) 可通过为 Azure ...

  9. Oracle EBS AP 应付核销到确定一行预付款

    -- purpose: 应付标准发票核销预付款发票中的一行 -- 12.2.6 环境 -- author:jenrry create_date: 2017-06-08 declare l_error_ ...

  10. python自学——文件处理(截取文件内容)

    #截断文件内容使用的函数为truncate()来截断文件中的内容# 注意当truncate()括号内没有定义对象时则会删除文件内容:当括号内为指定某个条件时文件会截取从0到指定位置的内容f=open( ...