This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 引入menkr cdn 提供的seajs源 和 配置文件 --> | |
<script src="http://cdn.menkr.com/sea.js" data-config="config/config.js" charset="utf-8"></script> | |
<script> | |
// 使用别名(alias)加载组件 | |
seajs.use(['jquery', 'moment'], function($, moment) { | |
$(document).ready(function() { | |
console.log('Menkr CDN 上线时间距离现在:') | |
console.log(moment("20130329", "YYYYMMDD").fromNow()) | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html(ng-app="app") | |
head | |
title demo | |
body | |
#wrap(ng-controller="myCtrl") | |
h1 我是 {{me.name}} , 我已经 {{me.age}} 岁了 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Book = function(name) { | |
this.name = name; | |
this.demo = '123'; | |
} | |
var Method = function() { | |
// 继承了 Book 的静态属性 this.demo = '123' | |
Book.apply(this, arguments); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "include.h" | |
/* | |
{ | |
"method":"helloworld.onoff", | |
"params":"on"/"off" | |
} | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sdk = require('sdk'); | |
// init a API | |
var demo = new sdk({ | |
read: { | |
url: '/demo/read/{{name}}', | |
method: 'get' | |
}, | |
update: { | |
url: '/demo/update', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
var rules = document.styleSheets[document.styleSheets.length-1].cssRules; | |
for (var idx = 0, len = rules.length; idx < len; idx++) { | |
$(rules[idx].selectorText).each(function (i, elem) { | |
elem.style.cssText += rules[idx].style.cssText; | |
}); | |
} | |
$('style').remove(); | |
$('script').remove(); | |
})(jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var server = require('express-scaffold'); | |
// init a new server running on default port 3000 | |
new server({ | |
name: "just another express app", | |
desc: "some desciption here", | |
database: { | |
name: "expressdemo" | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Depender = require('depender'); | |
dep = new Depender; | |
dep.define('text', '123'); | |
dep.define('text2', 'demo222222'); | |
dep.define('functionOne', function(msg) { | |
console.log(msg); | |
}); | |
dep.use(function(text2, text, functionOne, nonce) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var maps = { | |
'weibo': 'fa-weibo' | |
} | |
var parse = function(url) { | |
var a = document.createElement('a'); | |
a.href = url; | |
return a; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**! | |
* 微信内置浏览器的Javascript API,功能包括: | |
* | |
* 1、分享到微信朋友圈 | |
* 2、分享给微信好友 | |
* 3、分享到腾讯微博 | |
* 4、隐藏/显示右上角的菜单入口 | |
* 5、隐藏/显示底部浏览器工具栏 | |
* 6、获取当前的网络状态 | |
* |
OlderNewer