时间戳互相转换工具
var no=new Date().getTime();
console.log(no);
Date.prototype.format = function(format) {
var date = {
"M+": this.getMonth() + 1,
...
表单序列化添加额外数据
$.ajax({
type: "post",
url: "{:u('cart/totalByCard')}?t="+Math.random(9999),
data: {'address':address,'delivity':delivity,'payment':payment,$('#card_form').serializ...
用js获取语音并处理
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
<bod...
Notification通知
function popNotice() {
if (Notification.permission == "granted") {
var notification = n...
node搭建静态express服务器
var express = require('express');
var app = express();
app.use(express.static('./'));
var server = app.listen(3000, function () {
console.log('Example app listening on port 3000!')...
js操作cookie cookie.js
/*设置cookie*/
function setCookie(name, value, days){
if(days == null || days == ''){
days = 300;
}
var exp = new Date();
exp.setTime(exp.getTime() + days*24*60*60*10...
js检测用户是否打开调试工具(chrome)
(function(){ var re=/x/; var i=0; console.log(re); re.toString=function(){ window.close(); return '第'+(++i)+'次打开控制台'; } })();