码迷,mamicode.com
首页 >  
搜索关键字:function    ( 54714个结果
Generate Parentheses
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: A ...
分类:其他好文   时间:2016-08-10 00:53:11    阅读次数:131
Object.prototype 与 Function.prototype 与 instanceof 运算符
方法: hasOwnProperty 该方法用来判断一个对象中的某一个属性是否是自己提供的( 住要用在判断属性是原型继承的还是自己提供的 ) 语法: 对象.hasOwnProperty( '属性名' ) -> boolean isPrototypeOf 凡是看到 of 翻译成 的, 反过来翻译: p ...
分类:其他好文   时间:2016-08-10 00:47:32    阅读次数:196
ES5 对数组方法的扩展 以及 正则表达式
ES5 对数组的扩展 forEach 与 map 语法: 1. forEach 就是在模拟 jq 中 each 例:var arr = [ 11, 22, 33 ]; var res = arr.forEach(function ( v, i ) { // 遍历数据 console.log( i + ...
分类:编程语言   时间:2016-08-10 00:36:29    阅读次数:292
关于radio属性如何添加成为双击取消
你只需要在script标签中加入<script type="text/javascript">var flag=true;function checkRadio(e){ e.checked=flag; flag=!flag; }</script><input type="radio" name="1 ...
分类:其他好文   时间:2016-08-09 22:14:44    阅读次数:407
jquery : 菜单根据url变颜色
//菜单根据url变颜色$(document).ready(function(){ $('#nav li a').each(function(){ if($($(this))[0].href==String(window.location)) $(this).parent().addClass('o ...
分类:Web程序   时间:2016-08-09 18:46:53    阅读次数:247
回车事件
/* 回车事件 */document.onkeydown = function (e) { var theEvent = window.event || e; var code = theEvent.keyCode || theEvent.which; if (code == 13) { $('#s ...
分类:其他好文   时间:2016-08-09 18:44:13    阅读次数:109
LeetCode: 344. Reverse String
Write a function that takes a string as input and returns the string reversed. Example:Given s = "hello", return "olleh". 题目大意就是给一个字符串,得到倒序字符串 corner ...
分类:其他好文   时间:2016-08-09 13:41:17    阅读次数:151
一个特别不错的jQuery快捷键插件:js-hotkeys
这其实不是什么新技术,这个插件在很早前就已经发布了,之前有项目用到,所以分享出来添加方式的例子 jQuery.hotkeys.add('esc',function (){ //执行函数 }); jQuery.hotkeys.add('Ctrl+a',function (){ //执行函数 }); 支 ...
分类:Web程序   时间:2016-08-09 13:41:13    阅读次数:163
完善分页插件,增加内部成员,确定控件是否已经初始化过一次。
//代码整理:懒人之家 www.lanrenzhijia.com//分页插件/**2014-08-05 ch2016-07-19 Modified By RenGuoQiang**/(function($){ var ms = { init:function(obj,args){ return (f ...
分类:其他好文   时间:2016-08-09 13:30:25    阅读次数:185
解决AJAX应用,会话超时(Session Timeout)的问题,粗略方法(不考虑使用Filter的前提下)
function ajaxPost(url, data) { var async = false; var result = {}; $.ajax({ url : url, async : async, cache : false, data : data, type : "POST",// bef ...
分类:Web程序   时间:2016-08-09 12:01:21    阅读次数:276
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!