摘要: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; }
阅读全文
摘要:<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;//防止死循环 } } ...
阅读全文
摘要:拿到别人的代码,一个对象属性值非常复杂,但是在某些情况下有没有调试工具,如何办?如何查看对象的所有属性?一下代码可以解决这个问题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])){//濡傛灉涓烘暟缁? ...
阅读全文
摘要:var string="asdf"alert(string[0]); IE 6 7 下为undefined
阅读全文
摘要:转自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...
阅读全文
摘要:var asdf = function(){} (function(){ })()解决方案:var asdf = function(){}; (function(){ })()
阅读全文
摘要:// 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.
阅读全文
摘要:/**! * 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'
阅读全文
摘要:<!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
阅读全文
摘要:iphone3gs自带的Safari浏览器Mozilla/5.0 (iPhone:U;CPU iPhone OS 4_1 like Mac OS X;zh-cn) AppleWebKit/532.9(KHTML,like Gecko)Version/4.0.5 Mobile/8B117 Safari/6531.22.7QQ浏览器MQQBrowser/2801Mozilla/5.0 (iPhone:U;CPU iPhone OS 4_1 like Mac OS X;zh-cn) AppleWebKit/532.9(KHTML,like Gecko)Version/4.0.5 Mobile/8B1
阅读全文
摘要:// RSA, a suite of routines for performing RSA public-key computations in// JavaScript.//// Requires BigInt.js and Barrett.js.//// Copyright 1998-2005 David Shapiro.//// You may use, re-use, abuse, copy, and modify this code to your liking, but// please keep this header.//// Thanks!// // Dave Shapir
阅读全文
摘要:// BigInt, a suite of routines for performing multiple-precision arithmetic in// JavaScript.//// Copyright 1998-2005 David Shapiro.//// You may use, re-use, abuse,// copy, and modify this code to your liking, but please keep this header.// Thanks!//// Dave Shapiro// dave@ohdave.com// IMPORTANT THING
阅读全文
摘要:<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html lang="en"><head><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><meta name="Author" content="Dave Shapiro"><meta n
阅读全文
摘要:<!DOCTYPE html><html lang="zh-cn"><head><meta http-equiv="content-type" content="text/html;charset=utf-8"><title>DES算法</title></head><body><script>//Javascript version//Paul Tero, July 2001//http://www.shopable.co.uk
阅读全文
摘要:<!DOCTYPE html><html lang="zh-cn"><head><meta http-equiv="content-type" content="text/html;charset=utf-8"><title>DES算法-Code by 梅雪香</title><style type="text/css">textarea{width:600px; height:150px;}body{font-size:12px}i
阅读全文
摘要:用法:md5Value = hex_md5("asdfasdf")<script>/** A JavaScript implementation of the RSA Data Security, Inc. MD5 Message* Digest Algorithm, as defined in RFC 1321.* Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet* Distrib
阅读全文
摘要:子页面:/AAA/AAA.html父页面:/BBB/BBB.html子页面中代码如下parent.window.location="CCC.html"结果:父页面跳转到:/AAA/CCC.html
阅读全文