码迷,mamicode.com
首页 >  
搜索关键字:function    ( 54714个结果
JS 显示图片层
//imgFrame显示层,imgbox显示的内容 关闭 //img路径 ' width="90" height="50" onclick="showOriginal('',event);">//层的关闭按钮方法function clos...
分类:Web程序   时间:2014-06-14 17:19:35    阅读次数:262
JS下的复制粘贴
IE : 1 2 3 body内 1 function copyToClipboard() { 2 3 if (document.all) { //判断...
分类:Web程序   时间:2014-06-14 16:29:02    阅读次数:186
[LeetCode] Remove Duplicates from Sorted Array II
Follow up for ”Remove Duplicates”: What if duplicates are allowed at most twice?For example, Given sorted array A = [1,1,1,2,2,3],Your function should...
分类:其他好文   时间:2014-06-14 16:08:32    阅读次数:200
JS乘法口诀表(一行代码)
(function(c){for(i=1;i<=9;i++){var s='';for(j=1;j<=i;j++){s+=i+'X'+j+'='+i*j+'\t';}c.debug(s);}})(console)...
分类:Web程序   时间:2014-06-14 12:56:33    阅读次数:216
void 0 或者 undefined
Problem 在检查一个值是否为undefined的时候,你们是如果去测试的? 要是之前的我会这样子测试 function isUndefined(obj){ return obj === undefined; } 但是最近在看《javascript框架设计》这本书的时候,他用了另外一种方法,我就有点纳闷了。 function isUndefined(obj){...
分类:其他好文   时间:2014-06-14 12:50:24    阅读次数:264
[LeetCode] Search in Rotated Sorted Array II [36]
题目 Follow up for "Search in Rotated Sorted Array": What if duplicates are allowed? Would this affect the run-time complexity? How and why? Write a function to determine if a given target is in the array. 原题链接(点我) 解题思路 这题和Search in Rotated Sorted Array问题类似,...
分类:其他好文   时间:2014-06-14 12:44:18    阅读次数:266
Javascript 设计模式 单例
一直很喜欢Js,,,今天写一个Js的单例模式实现以及用法。 1、单例模式的写法 单例模式写法相当简单: var singleTon = { m1: "memeber first ", m2: "memeber second ", f1: function () {...
分类:编程语言   时间:2014-06-14 12:17:38    阅读次数:259
Acdreamoj1116(Gao the string!)字符串hash+二分+矩阵快速幂
Problem Description give you a string, please output the result of the following function mod 1000000007 n is the length of the string f() is the function of fibonacci, f(0) = 0, f(1) = 1... a...
分类:其他好文   时间:2014-06-14 11:45:49    阅读次数:243
input输入什么div图层显示什么
.ppp{           width:600px;      height:300px;      background-color:pink;      }                 $("document").ready(function(){             $("#ttt").keyup(          ...
分类:其他好文   时间:2014-06-14 10:07:32    阅读次数:167
socket.io获取客户端的IP地址(修正官方1.0.4版本BUG)
之前我有看过别人写的文章,说到如何获取客户端IP地址,代码如下:var io = require("socket.io").listen(server);io.sockets.on("connection", function (socket) { var address = sock...
分类:其他好文   时间:2014-06-14 08:48:28    阅读次数:412
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!