摘要:$("#account").val( "彭君华,郑洁,钟汉唐".split(",")[Math.floor(Math.random()*3)] );
阅读全文
摘要:call 方法 (Function) (JavaScript) 调用一个对象的方法,用另一个对象替换当前对象。 调用一个对象的方法,用另一个对象替换当前对象。 调用一个对象的方法,用另一个对象替换当前对象。 调用一个对象的方法,用另一个对象替换当前对象。 1.var write = document
阅读全文
摘要:From :http://www.lxway.com/905550421.htm 又如: 这些小图片就是整图分割后的各个部分,把各个部分放在一张图片上,而不是是分别存储成单独的图片,其目的我们都知道,就是减少http请求次数,节省时间和带宽。 那么怎么来实现一张图片在不同的地方只显示其中的一部分呢,
阅读全文
摘要:CSS 每段缩进,段落开头前面空两格 text-indent:2em rgba(0,0,0,0.3)
阅读全文
摘要:13down vote basically instead of using the link to move pages (or anchors), using this method launches a javascript function(s) <script> function doSo
阅读全文
摘要:var weekday = foo.toString().substr(0, 3);
阅读全文
摘要:var yt = { checkBlur:function(obj){ var num = $(obj).val(); var hint=$(obj).parent().next().next(); var hintText=hint...
阅读全文
摘要:// 方法 1:$('.form_ele').attr('disabled', true); // 方法 2:$('.form_ele').attr('disabled', 'disabled');attr('readonly',true); 都不能submit上传
阅读全文
摘要:// $('input[type="text"]').each(function(){ // if($(this).val() == '') // alert('no'); // 不需要加 # ,封装过啦
阅读全文
摘要:在《JavaScript: The Definitive Guide, 4th Edition》中写到: In client-side JavaScript, a common use of escape( ) is to encode cookie values, which have restr...
阅读全文
摘要:如何调用函数就很简单,直接使用setCookie("名","值")、getCookie("名")、delCookie("名")!访问Cookie 代码如下 复制代码document.write(document.cookie);//输出类似"name1=value1; name2=valu...
阅读全文
摘要:$('input[type=radio][name=bill]').change(function() { if (this.value == '1') { $('.bill').css('display','block'); } el...
阅读全文
摘要:半角的不断行的空白格(推荐使用)  半角的空格   全角的空格
阅读全文
摘要:up vote33down voteacceptedwindow.location sets the url of your current window. To open a new window, you need to use window.open. This should work:fun...
阅读全文
摘要:1.数字转换成字符串 var a=10;a=string(a)2.字符串转换成数字var a ='10';a=Number(a);3.返回十进制整数a=parseInt(a,10);//第二位表示是进制,如果是2进制,就改成24返回浮点型var a="24.68tt";a=parseFloat(...
阅读全文
摘要:js字符串截取函数slice()、substring()、substr();时间对象要用toString()方法转换成字符串
阅读全文
摘要:document.getElementById("bigclass").value
阅读全文