博客园 - kxdhm
uuid:24b78886-0ed1-41c2-8670-e3f31dcf42c4;id=150254
2012-06-23T09:15:45Z
kxdhm
https://www.cnblogs.com/kxdhm/
feed.cnblogs.com
https://www.cnblogs.com/kxdhm/archive/2012/06/23/2559216.html
json转字符串 - kxdhm
function json2str(o) { function isArray(o) { return Object.prototype.toString.call(o) === '[object Array]'; } var arr = []; var fmt = function(s) { var type = typeof s; if (type == 'object' && s != null){ return self.json2str(s); } if(type === "number"){ return s; }
2012-06-23T03:33:00Z
2012-06-23T03:33:00Z
kxdhm
https://www.cnblogs.com/kxdhm/
【摘要】function json2str(o) { function isArray(o) { return Object.prototype.toString.call(o) === '[object Array]'; } var arr = []; var fmt = function(s) { var type = typeof s; if (type == 'object' && s != null){ return self.json2str(s); } if(type === "number"){ return s; } <a href="https://www.cnblogs.com/kxdhm/archive/2012/06/23/2559216.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/kxdhm/archive/2012/06/02/2531585.html
window.onerror不会死循环 - kxdhm
<script>(function(){ window.onerror = function(msg,url,line){ var c = {}; if(!window.onerror.xxx){ try{ version = c.c.c;//出错,会不会触发window.onerror?调试证明,不会循环触发 }catch(e){ window.onerror.xxx = true;//防止死循环 } } ...
2012-06-02T01:58:00Z
2012-06-02T01:58:00Z
kxdhm
https://www.cnblogs.com/kxdhm/
【摘要】<script>(function(){ window.onerror = function(msg,url,line){ var c = {}; if(!window.onerror.xxx){ try{ version = c.c.c;//出错,会不会触发window.onerror?调试证明,不会循环触发 }catch(e){ window.onerror.xxx = true;//防止死循环 } } ... <a href="https://www.cnblogs.com/kxdhm/archive/2012/06/02/2531585.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/kxdhm/archive/2012/05/23/2514114.html
IE9下,某种方式提交表单元素,IE9 crash,必先 - kxdhm
具体什么原因还没查清楚。<!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 charset="utf-8"><title>朋友网</title>&l
2012-05-22T16:44:00Z
2012-05-22T16:44:00Z
kxdhm
https://www.cnblogs.com/kxdhm/
【摘要】具体什么原因还没查清楚。<!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 charset="utf-8"><title>朋友网</title>&l <a href="https://www.cnblogs.com/kxdhm/archive/2012/05/23/2514114.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/kxdhm/archive/2012/05/15/2500935.html
IE6上Gzip+Etag问题的解决方案 - kxdhm
转载这个问题不是太广为人知,但也算不上新鲜知识了,IE6如果接收到一个gzip压缩的http响应,那么这个响应中的Etag信息会被抛弃,此时只能依赖last-modified时间来设计cache策略。某些类型的Vary值据说也会导致相同的问题。为了这个问题emu在http头上动了n多手术,甚至把200响应状态硬生生换成206等状态,IE6一直都非常顽固的不肯吐出If-None-Match信息。几乎要放弃了。 丢开这个bug,我们来看问题的实质是什么。实质是,我们有一个叫做Etag的,响应内容的一个hash值,需要在响应的时候从服务器送给浏览器,并且要求在浏览器下次请求同一个路径的时候把这个ha
2012-05-15T01:36:00Z
2012-05-15T01:36:00Z
kxdhm
https://www.cnblogs.com/kxdhm/
【摘要】转载这个问题不是太广为人知,但也算不上新鲜知识了,IE6如果接收到一个gzip压缩的http响应,那么这个响应中的Etag信息会被抛弃,此时只能依赖last-modified时间来设计cache策略。某些类型的Vary值据说也会导致相同的问题。为了这个问题emu在http头上动了n多手术,甚至把200响应状态硬生生换成206等状态,IE6一直都非常顽固的不肯吐出If-None-Match信息。几乎要放弃了。 丢开这个bug,我们来看问题的实质是什么。实质是,我们有一个叫做Etag的,响应内容的一个hash值,需要在响应的时候从服务器送给浏览器,并且要求在浏览器下次请求同一个路径的时候把这个ha <a href="https://www.cnblogs.com/kxdhm/archive/2012/05/15/2500935.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/kxdhm/archive/2012/04/01/2428940.html
js遍历属性,返回字符串 - kxdhm
拿到别人的代码,一个对象属性值非常复杂,但是在某些情况下有没有调试工具,如何办?如何查看对象的所有属性?一下代码可以解决这个问题function WalkP(obj,showString){ if(!WalkP.isArray(obj)){ var str = "{\n"; for(var o in obj){ var value = "'"+(typeof obj[o]).toUpperCase()+"'"; if(WalkP.isArray(obj[o])){//濡傛灉涓烘暟缁? ...
2012-04-01T08:06:00Z
2012-04-01T08:06:00Z
kxdhm
https://www.cnblogs.com/kxdhm/
【摘要】拿到别人的代码,一个对象属性值非常复杂,但是在某些情况下有没有调试工具,如何办?如何查看对象的所有属性?一下代码可以解决这个问题function WalkP(obj,showString){ if(!WalkP.isArray(obj)){ var str = "{\n"; for(var o in obj){ var value = "'"+(typeof obj[o]).toUpperCase()+"'"; if(WalkP.isArray(obj[o])){//濡傛灉涓烘暟缁? ... <a href="https://www.cnblogs.com/kxdhm/archive/2012/04/01/2428940.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/kxdhm/archive/2012/03/15/2397741.html
IE6/7 字符串 数组方式获取字符 不支持 - kxdhm
var string="asdf"alert(string[0]); IE 6 7 下为undefined
2012-03-15T03:52:00Z
2012-03-15T03:52:00Z
kxdhm
https://www.cnblogs.com/kxdhm/
【摘要】var string="asdf"alert(string[0]); IE 6 7 下为undefined <a href="https://www.cnblogs.com/kxdhm/archive/2012/03/15/2397741.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/kxdhm/archive/2012/03/14/2396159.html
IE html5 header footer nav article section - kxdhm
<!--[if ie]><script>document.createelement("header");document.createelement("footer");document.createelement("nav");document.createelement("article");document.createelement("section");</script><![endif]--> <!--[if ie]>&l
2012-03-14T08:38:00Z
2012-03-14T08:38:00Z
kxdhm
https://www.cnblogs.com/kxdhm/
【摘要】<!--[if ie]><script>document.createelement("header");document.createelement("footer");document.createelement("nav");document.createelement("article");document.createelement("section");</script><![endif]--> <!--[if ie]>&l <a href="https://www.cnblogs.com/kxdhm/archive/2012/03/14/2396159.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/kxdhm/archive/2012/03/12/2392074.html
javascript tea加密 - kxdhm
转自http://www.movable-type.co.uk/scripts/tea-block.html/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *//* Block TEA (xxtea) Tiny Encryption Algorithm implementation in JavaScript *//* (c) Chris Veness 2002-2010: www.movable...
2012-03-12T09:02:00Z
2012-03-12T09:02:00Z
kxdhm
https://www.cnblogs.com/kxdhm/
【摘要】转自http://www.movable-type.co.uk/scripts/tea-block.html/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *//* Block TEA (xxtea) Tiny Encryption Algorithm implementation in JavaScript *//* (c) Chris Veness 2002-2010: www.movable... <a href="https://www.cnblogs.com/kxdhm/archive/2012/03/12/2392074.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/kxdhm/archive/2012/03/06/2382492.html
一个不容易觉察到的js错误,function () {}(function () {}) is not a functio - kxdhm
var asdf = function(){} (function(){ })()解决方案:var asdf = function(){}; (function(){ })()
2012-03-06T11:30:00Z
2012-03-06T11:30:00Z
kxdhm
https://www.cnblogs.com/kxdhm/
【摘要】var asdf = function(){} (function(){ })()解决方案:var asdf = function(){}; (function(){ })() <a href="https://www.cnblogs.com/kxdhm/archive/2012/03/06/2382492.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/kxdhm/archive/2012/02/22/2363631.html
知识点记录 - kxdhm
css动画el.style.webkitTransitionDuration = "0";el.style.webkitTransitionTimingFunction = "none";el.style.webkitTransform = "none";<div style="width: 4em; height: 4em; margin: 2em; background-color: blue; color: white; -webkit-transition-duration: 5s; -webkit-trans
2012-02-22T11:46:00Z
2012-02-22T11:46:00Z
kxdhm
https://www.cnblogs.com/kxdhm/
【摘要】css动画el.style.webkitTransitionDuration = "0";el.style.webkitTransitionTimingFunction = "none";el.style.webkitTransform = "none";<div style="width: 4em; height: 4em; margin: 2em; background-color: blue; color: white; -webkit-transition-duration: 5s; -webkit-trans <a href="https://www.cnblogs.com/kxdhm/archive/2012/02/22/2363631.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/kxdhm/archive/2012/02/21/2361754.html
zepto.js 手机web开发 js 框架,类似于jquery - kxdhm
// Zepto.js// (c) 2010, 2011 Thomas Fuchs// Zepto.js may be freely distributed under the MIT license.(function(undefined){ if (String.prototype.trim === undefined) // fix for iOS 3.2 String.prototype.trim = function(){ return this.replace(/^\s+/, '').replace(/\s+$/, '') }; // For iO.
2012-02-21T10:37:00Z
2012-02-21T10:37:00Z
kxdhm
https://www.cnblogs.com/kxdhm/
【摘要】// Zepto.js// (c) 2010, 2011 Thomas Fuchs// Zepto.js may be freely distributed under the MIT license.(function(undefined){ if (String.prototype.trim === undefined) // fix for iOS 3.2 String.prototype.trim = function(){ return this.replace(/^\s+/, '').replace(/\s+$/, '') }; // For iO. <a href="https://www.cnblogs.com/kxdhm/archive/2012/02/21/2361754.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/kxdhm/archive/2012/02/21/2361751.html
iscroll.js 用法介绍 - kxdhm
概要iScroll 4 这个版本完全重写了iScroll这个框架的原始代码。这个项目的产生完全是因为移动版webkit浏览器(诸如iPhone,iPad,Android 这些系统上广泛使用)提供了一种本地化的方式来对一个限定了高度和宽度的元素的内容进行滑动。很不幸的是,这种情况下所有的web应用的页面就不能够包含具有position:absolute的头、页尾或者是一个内容可滚动的中间区域。然而,Android系统最新修订版已经可以支持这种功能了(尽管支持的力度还不是特别好),Apple公司似乎不太情愿将one-finger滑动事件运用到div元素上。除了以前版本的iScroll的特性以外,i
2012-02-21T10:35:00Z
2012-02-21T10:35:00Z
kxdhm
https://www.cnblogs.com/kxdhm/
【摘要】概要iScroll 4 这个版本完全重写了iScroll这个框架的原始代码。这个项目的产生完全是因为移动版webkit浏览器(诸如iPhone,iPad,Android 这些系统上广泛使用)提供了一种本地化的方式来对一个限定了高度和宽度的元素的内容进行滑动。很不幸的是,这种情况下所有的web应用的页面就不能够包含具有position:absolute的头、页尾或者是一个内容可滚动的中间区域。然而,Android系统最新修订版已经可以支持这种功能了(尽管支持的力度还不是特别好),Apple公司似乎不太情愿将one-finger滑动事件运用到div元素上。除了以前版本的iScroll的特性以外,i <a href="https://www.cnblogs.com/kxdhm/archive/2012/02/21/2361751.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/kxdhm/archive/2012/02/21/2361750.html
iscroll.js 触屏手机web-kit浏览器滚动效果代码库 - kxdhm
/**! * iScroll v4.1.8 ~ Copyright (c) 2011 Matteo Spinelli, http://cubiq.org * Released under MIT license, http://cubiq.org/license */(function(){var m = Math, vendor = (/webkit/i).test(navigator.appVersion) ? 'webkit' : (/firefox/i).test(navigator.userAgent) ? 'Moz' : 'opera'
2012-02-21T10:34:00Z
2012-02-21T10:34:00Z
kxdhm
https://www.cnblogs.com/kxdhm/
【摘要】/**! * iScroll v4.1.8 ~ Copyright (c) 2011 Matteo Spinelli, http://cubiq.org * Released under MIT license, http://cubiq.org/license */(function(){var m = Math, vendor = (/webkit/i).test(navigator.appVersion) ? 'webkit' : (/firefox/i).test(navigator.userAgent) ? 'Moz' : 'opera' <a href="https://www.cnblogs.com/kxdhm/archive/2012/02/21/2361750.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/kxdhm/archive/2012/02/17/2355615.html
火狐下的ul li inline-block float导致的差异 - kxdhm
<!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-
2012-02-17T04:55:00Z
2012-02-17T04:55:00Z
kxdhm
https://www.cnblogs.com/kxdhm/
【摘要】<!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- <a href="https://www.cnblogs.com/kxdhm/archive/2012/02/17/2355615.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/kxdhm/archive/2012/02/16/2353966.html
a标签几种状态在IE6 7下的表现 - kxdhm
a{text-decoration:none;color:#84a8c8;}a:link{color:#4199d7}a:visited{color:#0ff;}a:hover{color:#f00;cursor: pointer;}a:active{color:#ff0;}<a href="javascript:;">asdfasdf</a>IE6 7 下,点击,鼠标up时,颜色始终为active的颜色,其他浏览器为hover的颜色与设计的效果不符,添加事件,mouseover mouseout click
2012-02-16T04:06:00Z
2012-02-16T04:06:00Z
kxdhm
https://www.cnblogs.com/kxdhm/
【摘要】a{text-decoration:none;color:#84a8c8;}a:link{color:#4199d7}a:visited{color:#0ff;}a:hover{color:#f00;cursor: pointer;}a:active{color:#ff0;}<a href="javascript:;">asdfasdf</a>IE6 7 下,点击,鼠标up时,颜色始终为active的颜色,其他浏览器为hover的颜色与设计的效果不符,添加事件,mouseover mouseout click <a href="https://www.cnblogs.com/kxdhm/archive/2012/02/16/2353966.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/kxdhm/archive/2012/02/16/2353750.html
webkit webkitTransform -webkit-transition-duration -webkit-transition-function - kxdhm
<div style="width: 4em; height: 4em; margin: 2em; background-color: blue; color: white; -webkit-transition-duration: 5s; -webkit-transition-function: ease-out;" onclick='style.webkitTransform="translate(16em, -16em) scale(6) rotate(720deg)"; style.backgroundColor="red
2012-02-16T02:55:00Z
2012-02-16T02:55:00Z
kxdhm
https://www.cnblogs.com/kxdhm/
【摘要】<div style="width: 4em; height: 4em; margin: 2em; background-color: blue; color: white; -webkit-transition-duration: 5s; -webkit-transition-function: ease-out;" onclick='style.webkitTransform="translate(16em, -16em) scale(6) rotate(720deg)"; style.backgroundColor="red <a href="https://www.cnblogs.com/kxdhm/archive/2012/02/16/2353750.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/kxdhm/archive/2012/02/16/2353751.html
-webkit-transform - kxdhm
<img src="/phone/img/bg.jpg" style="-webkit-transform:rotate(45deg)" /></div>
2012-02-16T02:55:00Z
2012-02-16T02:55:00Z
kxdhm
https://www.cnblogs.com/kxdhm/
【摘要】<img src="/phone/img/bg.jpg" style="-webkit-transform:rotate(45deg)" /></div> <a href="https://www.cnblogs.com/kxdhm/archive/2012/02/16/2353751.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/kxdhm/archive/2012/02/14/2351692.html
有用的网址 - kxdhm
iphone开发https://developer.apple.com/library/safari/navigation/index.htmlhttps://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariWebContent/Introduction/Introduction.html#//apple_ref/doc/uid/TP40002079-SW1http://www.cn-cuckoo.com/deconstructed/JavaScript库“解构”系列旨在以可
2012-02-14T10:10:00Z
2012-02-14T10:10:00Z
kxdhm
https://www.cnblogs.com/kxdhm/
【摘要】iphone开发https://developer.apple.com/library/safari/navigation/index.htmlhttps://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariWebContent/Introduction/Introduction.html#//apple_ref/doc/uid/TP40002079-SW1http://www.cn-cuckoo.com/deconstructed/JavaScript库“解构”系列旨在以可 <a href="https://www.cnblogs.com/kxdhm/archive/2012/02/14/2351692.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/kxdhm/archive/2012/02/13/2349474.html
IE6 fixed - kxdhm
<!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-
2012-02-13T07:07:00Z
2012-02-13T07:07:00Z
kxdhm
https://www.cnblogs.com/kxdhm/
【摘要】<!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- <a href="https://www.cnblogs.com/kxdhm/archive/2012/02/13/2349474.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/kxdhm/archive/2012/02/10/2345923.html
HTML5 Geolocation - kxdhm
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Geolocation API</title></head><body><p><script>if(navigator.geolocation){ navigator.geolocation.getCurrentPosition( f
2012-02-10T10:11:00Z
2012-02-10T10:11:00Z
kxdhm
https://www.cnblogs.com/kxdhm/
【摘要】<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Geolocation API</title></head><body><p><script>if(navigator.geolocation){ navigator.geolocation.getCurrentPosition( f <a href="https://www.cnblogs.com/kxdhm/archive/2012/02/10/2345923.html" target="_blank">阅读全文</a>