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 js = {} | |
js.lang = {} | |
js.lang.String = function () { | |
this.REGX_HTML_ENCODE = /"|&|'|<|>|[\x00-\x20]|[\x7F-\xFF]|[\u0100-\u2700]/g; | |
this.REGX_HTML_DECODE = /&\w+;|&#(\d+);/g; | |
this.REGX_TRIM = /(^\s*)|(\s*$)/g; |
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
一个同样的url返回不同内容的时候,服务器根据它来判断返回不同的内容。 | |
例如 | |
Vary: Accept-Encoding | |
Accept-Encoding: gzip; | |
对应====> | |
Content-Encoding: gzip; | |
的内容 | |
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
也就是说 Vary 字段用于列出一个响应字段列表,告诉缓存服务器遇到同一个 URL 对应着不同版本文档的情况时,如何缓存和筛选合适的版本。 |
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 throttle = function (fn,delay, immediate, debounce) { | |
var curr = +new Date(),//当前事件 | |
last_call = 0, | |
last_exec = 0, | |
timer = null, | |
diff, //时间差 | |
context,//上下文 | |
args, | |
exec = function () { | |
last_exec = curr; |
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
//parse and organize all QS parameters in a more comfortable way | |
var params = {}; | |
if (location.search.length > 1) { | |
var i, arr = location.search.substr(1).split("&"); | |
for (i = 0; i < arr.length; i++) { | |
arr[i] = arr[i].split("="); | |
params[arr[i][0]] = unescape(arr[i][1]); | |
} | |
} |
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
#install | |
yum install mysql-server | |
#auto start on rebooting | |
chkconfig mysqld on | |
#start | |
service mysqld start | |
(service mysqld stop) | |
(service mysqld restart) |
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
// 判断是否为移动端运行环境 | |
// wukong.name 20130716 | |
if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))){ | |
if(window.location.href.indexOf("?mobile")<0){ | |
try{ | |
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
<link rel="stylesheet" type="text/css" href="./syntaxhighlighter/styles/shCoreDefault.css"> | |
<script src="./syntaxhighlighter/scripts/shCore.js"></script> | |
<script src="./syntaxhighlighter/scripts/shBrushJScript.js"></script> | |
<script src="./syntaxhighlighter/scripts/shBrushXml.js"></script> | |
<script src="./syntaxhighlighter/scripts/shBrushCss.js"></script> | |
<script>SyntaxHighlighter.all();</script> |
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 qUrl = (function() { | |
var q = window.location.search; | |
q = q ? q.split('?')[1].split('&') : []; | |
var query = {}; | |
jQuery(q).each(function(i) { | |
var t = q[i].split('='); | |
query[t[0]] = t[1] | |
}); | |
return query; | |
})(); |
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
jQuery.extend({ | |
createUploadIframe: function(id, uri) | |
{ | |
//create frame | |
var frameId = 'jUploadFrame' + id; | |
var iframeHtml = '<iframe id="' + frameId + '" name="' + frameId + '" style="position:absolute; top:-9999px; left:-9999px"'; | |
if(window.ActiveXObject) |
NewerOlder