码迷,mamicode.com
首页 >  
搜索关键字:function    ( 54714个结果
String To Integer
1 var myAtoi = function(str) { 2 var res = 0, 3 i = 0, 4 isNegtive = false, 5 isFirst = true; 6 7 8 for (i = 0; i =...
分类:其他好文   时间:2015-12-24 20:52:28    阅读次数:236
JS 操作 Cookie
1 function setCookie(name, value, day) { 2 var oDate = new Date(); 3 oDate.setDate(oDate.getDate() + day); 4 document.coo...
分类:Web程序   时间:2015-12-24 20:50:23    阅读次数:237
Palindrome Number
1 var isPalindrome = function(x) { 2 var xR = 0, 3 xP = x > 0 ? x : -x; 4 5 while (xP != 0) { 6 xR = xR * 10 + (xP % 10); 7 ...
分类:其他好文   时间:2015-12-24 20:47:52    阅读次数:148
Merge Two Sorted Lists
1 /** 2 * Definition for singly-linked list. 3 * function ListNode(val) { 4 * this.val = val; 5 * this.next = null; 6 * } 7 */ 8 /** 9 ...
分类:其他好文   时间:2015-12-24 20:47:34    阅读次数:187
基于继承的拖拽
1 window.onload = function() { 2 new Drag("div1"); 3 new LimitDrag("div2"); 4 }; 5 6 //父类 7 function Drag(id) { 8 ...
分类:其他好文   时间:2015-12-24 20:43:51    阅读次数:135
Reverse Integer
1 var reverse = function(x) { 2 var isNeg = false, 3 res = 0, 4 temp = 0; 5 6 if (x 2147483648) {14 return 0;15...
分类:其他好文   时间:2015-12-24 20:43:08    阅读次数:151
Ctrl+Enter 提交聊天信息
1 window.onload = function() { 2 var content = document.getElementById("content"); 3 var info = document.getElementById("info"); ...
分类:其他好文   时间:2015-12-24 20:42:44    阅读次数:115
Add Two Numbers
1 var addTwoNumbers = function(l1, l2) { 2 var sum = l1.val + l2.val, 3 l3 = new ListNode(sum % 10), 4 node = l3; 5 6 l1 = l...
分类:其他好文   时间:2015-12-24 20:41:50    阅读次数:143
只能输入数字的INPUT
1 window.onload = function() { 2 var content = document.getElementById("content"); 3 4 content.onkeypress = function(ev) { 5 ...
分类:其他好文   时间:2015-12-24 20:41:11    阅读次数:146
Two Sum
1 var twoSum = function(nums, target) { 2 var len = nums.length, 3 i = 0, 4 hash = {}, 5 res = [], 6 t1, t2; 7 8...
分类:其他好文   时间:2015-12-24 20:40:58    阅读次数:154
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!