<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. Oracle中SQL语句转化IP地址到数字

    CREATE OR REPLACE FUNCTION ip_num(ipaddress IN VARCHAR2) RETURN NUMBER AS ipnum ; pos1 ; pos2 ; BEGI ...

  2. Nginx基本的安全优化

    为了防止nginx出现软件漏洞,我们要对nginx软件服务加强一些安全性,下面就介绍一下基本的安全优化 1.隐藏nginx版本号: 想要隐藏,首先我们要了解所使用软件的版本号,我们可以在Linux中查 ...

  3. python实现简单的负载均衡

    提到分发请求,相信大多数人首先会想到Nginx,Nginx作为一种多功能服务器,不仅提供了反向代理隐藏主机ip的能力,还拥有简单的缓存加速功能.当然Nginx最强大的功能还是分发请求,不仅提供了哈希, ...

  4. Asp.Net Core使用System.Drawing.Common部署到docker报错问题

    Asp.Net Core 2.1发布后,正式支持System.Drawing.Common绘图了,可以用来做一些图片验证码之类的功能.但是把网站部署到docker容器里运行会遇到很多问题,也是非常闹心 ...

  5. EntityFramework 贪婪加载与延迟加载以及资源回收

    EntityFramework的资源回收 1) Using 内包含Entity的上下文关系,对俩表做Add操作,最好可以直接写一个 entity.SaveChanges(); 完成两张表的同时add操 ...

  6. 可选的binlog解析组件

    本文的mysql-binlog-connector-java:https://github.com/shyiko/mysql-binlog-connector-java 阿里的canal:https: ...

  7. MySQL: Building the best INDEX for a given SELECT

    Table of Contents The ProblemAlgorithmDigressionFirst, some examplesAlgorithm, Step 1 (WHERE "c ...

  8. 高通Audio中ASOC的machine驱动(一)

    ASoC被分为Machine.Platform和Codec三大部分,其中的Machine驱动负责Platform和Codec之间的耦合以及部分和设备或板子特定的代码,再次引用上一节的内容:Machin ...

  9. Linux运维之——每日小技巧,使用awk命令截取每行的指定列数据

    获取/etc/passwd目录下的UID值小于10的数,并输出第一.三列 [root@:vg_adn_tidbCkhsTest:172.31.30.62 ~]#cat /etc/passwd | aw ...

  10. linux命令2—常见linux命令

    1.进入vi的命令 vi filename :打开或新建文件,并将光标置于第一行首 vi +n filename :打开文件,并将光标置于第n行首 vi + filename :打开文件,并将光标置于 ...