This file contains hidden or 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 ip2long = function(ip){ip = ip.split(".");return (((ip[0] << 24) | (ip[1] << 16) | (ip[2] << 8) | ip[3]) >>> 0)} | |
var long2ip = function(ip){return [(ip >> 24) & 0xff,(ip >> 16) & 0xff,(ip >> 8) & 0xff,ip & 0xff].join(".")} |
This file contains hidden or 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
<!doctype html> | |
<html> | |
<head> | |
</head> | |
<body onload="init()"> | |
<script> | |
function init() | |
{ | |
var navigationTiming = performance.getEntriesByType("navigation")[0]; | |
if (window.console) console.log("Name: " + navigationTiming.name + "\n" + |
This file contains hidden or 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
<div class="box">动画选框</div> |
This file contains hidden or 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
/** | |
* 判断两个版本字符串的大小 | |
* @param {string} v1 原始版本 | |
* @param {string} v2 目标版本 | |
* @return {number} 如果原始版本大于目标版本,则返回大于0的数值, 如果原始小于目标版本则返回小于0的数值。0当然是两个版本都相等拉。 | |
*/ | |
function compareVersion(v1, v2) { | |
var _v1 = v1.split("."), | |
_v2 = v2.split("."), |
This file contains hidden or 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
/** | |
* DataURI转换成Blob格式 | |
* @param {string} dataURI base64 的 data uri | |
* @param {string} mimetype 需要输出的blob的mimetype格式 | |
* @return {Blob} 大二进制数据块 | |
*/ | |
var convertDataURIToBlob = function convertDataURIToBlob(dataURI, mimetype) { | |
//分割DataURI成 base64格式; | |
var BASE64_HEADER = ';base64,'; | |
var base64Index = dataURI.indexOf(BASE64_HEADER) + BASE64_HEADER.length; |
This file contains hidden or 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 http = require("http"); | |
var fs = require('fs'); | |
//默认启动http服务的路径 | |
var documentRoot = process.cwd(); | |
//默认文档名称 | |
var defaultDocument = "index.htm"; |