1、替换全部 String.prototype.replaceAll = function(s1, s2) { return this.replace(new RegExp(s1,…
function cutstr(str, len) { var temp, icount = 0, patrn = /[^\x00-\xff]/, strre = "&q…
1、字符串转换 字符串转换是最基础的要求和工作,你可以将任何类型的数据都转换为字符串,你可以用下面三种方法的任何一种: 1 2 var num= 19;&…
要实现多选框的选择相关映射,要实现以下逻辑: 1、全选框被点击时,所以子选框被选中。 2、当全选状态下,子选框的其中一个撤销…
<html> <head> <title>倒计时</title> <!--以下为css样式--> <style t…
$(document).ready(function() { //catch the right-click context menu $(document).bind("…
帮助在网页上快速加载图片,使它很容易保存和查看。 jQuery.preloadImagesInWebPage = function() { for(var ctr = 0; ctr…
function isCardNo(card) { // 身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X var reg…
function isCardNo(telno) { // 验证13 、15、18 开头的手机号 var reg = /^0?(13[0-9]|15[012356789]|18[0…
/* * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined * in FI…
/* * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined * in FIPS…
/* To Title Case 1.1.1 * David Gouch <http://individed.com> * 23 May 2008 * License:…