Wild Dog sample [sync data]
<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]的更多相关文章
- 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 ...
- [Hive - Tutorial] Data Units 数据存储单位
Data Units In the order of granularity - Hive data is organized into: 数据库.表.分区.桶 Databases: Namespac ...
- [转]Data Structure Recovery using PIN and PyGraphviz
Source:http://v0ids3curity.blogspot.com/2015/04/data-structure-recovery-using-pin-and.html --------- ...
- Sample Means(耶鲁大学教材)
Sample Means The sample mean from a group of observations is an estimate of the population mean. Giv ...
- 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 ...
- 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 ...
- NTFS格式下的Alternate Data Streams
今天我写点NTFS的交换数据流以及其带来的安全问题(Alternate Data Stream/ADS) =============================================== ...
- MVC---Case 1
<!DOCTYPE html> <html lang="en"> <head> <title>Backbone.js, Requir ...
- 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 ...
随机推荐
- SurfaceViewVideoList网络获取视频播放
主布局: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:andro ...
- ESLint 使用方法
一.全局安装 npm install -g eslint 二.生成配置文件 在项目根目录执行init,生成.eslintrc文件.在init时,要求根目录存在package.json.当然也可以直接复 ...
- Expo大作战(六)--expo开发模式,expo中exp命令行工具,expo中如何查看日志log,expo中的调试方式
简要:本系列文章讲会对expo进行全面的介绍,本人从2017年6月份接触expo以来,对expo的研究断断续续,一路走来将近10个月,废话不多说,接下来你看到内容,将全部来与官网 我猜去全部机翻+个人 ...
- Python之聚类(KMeans,KMeans++)
# -*- coding: utf-8 -*- """ Created on Mon Sep 17 16:41:46 2018 @author: zhen "& ...
- Oracle EBS 创建 RMA
DECLARE l_api_version_number NUMBER := 1; l_return_status VARCHAR2(2000); l_msg_count NUMBER; l_msg_ ...
- python下wxpython程序国际化的实践(中文英文切换)
一.什么是python的国际化(I18N) 有关I18N,百度上解释一大堆,个人比较喜欢这个说法. i18n是 Internationalization 这个英文的简写,因为International ...
- 深度访谈Amazon员工与HR:华裔因pip跳楼背后(图)
http://www.wenxuecity.com/news/2016/12/01/5813342.html 首先,让我们来回顾一下这起事件.两天前在某论坛中,有同学发了这么一个帖子,大致意思是说有一 ...
- 【转】Ubuntu做日常开发电脑的系统是一种怎样的体验
[原文]https://www.toutiao.com/i6594291159911105031/ Ubuntu 我现在已经基本不开windows了.学习娱乐开发基本都在Ubuntu 首先你要接受的是 ...
- Jenkins 基于 Docker git JAVA CI/CD
准备两台机器 192.168.31.200 centos7 docker harbor git 192.168.31.201 centos7 docker jenkins maven git Ha ...
- python使用mechanize模拟登陆新浪邮箱
mechanize相关知识准备: mechanize.Browser()<br># 设置是否处理HTML http-equiv标头 set_handle_equiv(True)<br ...