`
当时我就震惊了
  • 浏览: 32451 次
  • 性别: Icon_minigender_1
  • 来自: 火星
社区版块
存档分类
最新评论
文章列表
1.Always descend From an #id //The faster selector in jQuery is the ID selector ($('#elementid')) //This is because the ID SELECTOR maps directly to a native JavaScript //method,getElementById(); //***********************important tips*************************** //(1)kernel point. ...
== non-strict comparison operator //可以比较两个参数,即便是不同的类型 Example: var a = "1"; alert(a == 1); // true alert(a == "1"); //true === strict comparison operator //可以比较两个参数,但必须是相同的类型,否则返回false Example: var a = "1"; alert(a === 1);// false; a ...
'var x = 1' will create a variable within the current scope. Given this is declared in a function, x will not be available outside it, unless explicitly returned. 'x = 1' will create a variable within the global scope. Thus, any other code can access and alter its value. It's generally a bad p ...
/* Array Object refer to: http://www.w3schools.com/jsref/jsref_obj_array.asp */ //最快的 直接 = 复制操作是最快的。快一个数量级 arr = arrCopy //1.by slice var arr = [1,2,3],copyArr; copyArr = arr.slice(); //2.by concat var arr = [1,2,3],copyArr; copyArr = arr.concat(); // ...

Java reflection

    博客分类:
  • Java
/* My understanding on this is that JAVA REFELECTION is a container or an operator for a Class. */ //package reference import java.lang.reflect.*; //List the method(s) of a class. ... Class c = Class.forName("ClassName");//load the class' structure Method m[ ...
//需求: //Convert 20:33:24:34 to 20:33:24:034 //来吧,开刀 String instantStr = "20:33:24:34"; String resultStr = instantStr.replaceAll(":\\d{2}$","034"); //注意这里的正则式得加一个转义符 '\',写成这样\\d
//用到的类 DateUtils //这个类存在于 org.apache.commons.lang.time.DateUtils; //也就是这个包 commons-lang-2.3.jar //API文档在这里 //http://commons.apache.org/lang/api-2.5/org/apache/commons/lang/time/DateUtils.html //当年上学的时候第一次发现的时候就彻底震惊了 //一个例子毫秒加减 String sTime = "10:25:47:874"; ...
//正则表达式中的 特殊代码 \b 元字符(metacharacter) 代表 单词的开头或结尾,也就是单词的分解处 . 元字符 代表 匹配除了换行符以外的任意字符 *或+ 元字符 代表 它前面的字符可以连续重复的使用任意多次以使用整个表达式得到匹配 不同之处为 *包含0,+不包含0 tips:那么 .* 就代表任意数量的不包含换行的字符 \d 元字符 代表 匹配一位数字 - 不是元字符 代表 匹配它本身 - tips: \d{2} 代表重复2次匹配一位数字 \s 元字符 代表 任意的空白字符,包括空格,制表符 ...
现在已经是学会$.extend()函数的日后了.... 将新的函数的合并到JQuery函数库,这样就可以用$(selector)._cow_vaginal()的形式调用了 1.第一种方法(模版),总觉得这种写法不太正统 (function($){ $.fn.extend({ _Your_Function_Name:function(){ //very important property -- arguments //此默认参数用来日后获取调用该参数的 ...

jQuery.isArray()

jQuery.isArray( obj ) //测试obj是不是一个数组 //$.isArray() returns a Boolean indicating whether the object is a JavaScript array (not an array-like object, such as a jQuery object). <!DOCTYPE html> <html> <head> <script src="http://code.jquery.com/jquery-latest.js& ...
//函数原型 jQuery.each( collection, callback(indexInArray, valueOfElement) ) //collection The object or array to iterate over. //collection 需要迭代输出的对象 //callback(indexInArray, valueOfElement) The function that will be executed on every object. //callback(indexInArray, valueOfElement) 回调函数, ...
//Description: Merge the contents of two or more objects together into the first object. //描述:合并2个或多个对象到第一个对象 jQuery.extend( [deep], target, object1 [, objectN] ) /* -- deep If true, the merge becomes recursive (aka. deep copy). deep 如果为true,那么合并就变成递归形式(可选的参数) -- targ ...
Global site tag (gtag.js) - Google Analytics