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
/** | |
* 简易弹框 | |
*/ | |
define(function(require, exports) { | |
var funCreate = require("./elementCreate") | |
, funAjax = require("./ajax") | |
, overlay = require("./overlay"); | |
var eleWin = funCreate.create("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
/** | |
* 黑色半透明遮罩层 | |
*/ | |
define(function(require, exports, module) { | |
var elementCreate = require("./elementCreate"); | |
var overlay = (function() { | |
var element = elementCreate.create("div", { | |
styles: { | |
display: "none", |
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
/** | |
* 创建元素 | |
*/ | |
define(function(require, exports) { | |
exports.create = function(tagName, attr) { | |
var element = null; | |
if (typeof tagName === "string") { | |
element = document.createElement(tagName); | |
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
/** | |
* ajax方法 | |
*/ | |
define(function(require, exports) { | |
exports.get = function(url, succCall) { | |
if (url == undefined) { | |
console.log("请求地址缺失!"); | |
return; | |
} |
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
/** | |
* URL地址后面增加随机参数 | |
*/ | |
define(function(require, exports, module) { | |
exports.queryRandom = function(url) { | |
var strQueryRandom = "random=" + Math.random(); | |
var arrQuery = url.split("?"); | |
if (arrQuery[1] != undefined) { |
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
/** | |
* 主线js | |
* 点击小图查看大图测试 | |
*/ | |
define(function(require, exports) { | |
var query = require("./queryRandom") | |
, flbox = require("./flbox"); | |
exports.bind = function(element) { | |
element.onclick = function() { |
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 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta http-equiv="description" content="seajs spm使用测试之简易弹框实现 » 张鑫旭-鑫空间-鑫生活" /> | |
<meta name="description" content="seajs spm使用测试之简易弹框实现之实例页面" /> | |
<meta name="keywords" content="seajs, spm, node.js, nodejs" /> | |
<meta name="author" content="张鑫旭, zhangxixnu" /> | |
<title>seajs使用测试之简易弹框实现 » 张鑫旭-鑫空间-鑫生活</title> | |
<style> |
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
csser 使用的最简单的验证码,用的 node-canvas 模块 | |
var Canvas = require('canvas'); | |
module.exports = function (req, res) { | |
var canvas = new Canvas(100, 30), | |
ctx = canvas.getContext('2d'), | |
items = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPRSTUVWXYZ23456789'.split(''), | |
vcode = '', | |
textColors = ['#FD0', '#6c0', '#09F', '#f30', '#aaa', '#3cc', '#cc0', '#A020F0', '#FFA500', '#A52A2A', '#8B6914', '#FFC0CB', '#90EE90']; |
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
将mongodb的bin目录加入PATH环境变量中,例如: | |
export PATH=~/Develope-Tools/mongodb/bin:$PATH | |
,然后在主目录的.profile文件中增加shell命令的alias,如下: | |
alias mongostart="mongod -f ~/.mongodb.conf" |
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
<html> | |
<head> | |
<script type="text/javascript"> | |
alert(h);//function..... | |
alert(a);//undefined | |
var a = 3; | |
function h() { | |
alert('22'); | |
} |