随笔分类 - JQuery & JavaScript
摘要:创建元素包装集选择元素1 CSS选择器 这个小猿比较熟悉,为了给一组相同的页面元素设置相同的样式,会用到CSS选择器;2 子选择器 也就是万能的“>”号了吧。选择父元素的直接子元素,li > a,选择作为无序列表直接子元素的所有链接。3 特性选择器 a[href^=http://]选择是以ht...
阅读全文
摘要:I becoming love jQuery just because I only know javascript before. (^.^)document.getElementById("someId") ↓$("#someId")Seems everything is getting mor...
阅读全文
摘要:http://weizhifeng.net/immediately-invoked-function-expression.htmlvar f1 = function() { var res = []; var fun = null; for(var i = 0; i < 10; ...
阅读全文
摘要:1 jQuery.fn.single_double_click = function(single_click_callback, double_click_callback, timeout) { 2 return this.each(function(){ 3 var clicks...
阅读全文
摘要:1 $() vs $$("someSelector") returns a array. This is defiend in jQuery.prototype.$.methodName is a method defined in jQuery...2methods below will stop...
阅读全文
摘要:1 var sth = ""; //Global Scope2 var foo = function(){ var sth = ""; // Local Scope}3 var foo = function(){ sth = ""; // Global Scope, this isdefinit...
阅读全文
摘要:ArraysArrays are zero-indexed, ordered lists of values. They are a handy way to store a set of related items of the same type (such as strings), thoug...
阅读全文
摘要:A Brief LookDOM Traversal and ManipulationGet theelement with the class 'continue' and change its HTML to 'Next Step...'1$( "button.continue" ).html( ...
阅读全文
摘要:有些东西是JavaScript的对象,但是我们传递给javascript的时候只能给人家一个字符串,这个时候需要eval这个函数来解析被传递的字符串。
阅读全文
摘要:当JavaScript传递的参数为数字类型的字符串时要注意如果第一个字符是0的话,十有六七会出问题。问题1: 会被认为是8进制的数字处理;问题2: 会把前面的0给去掉。建议:在传递的值为数字类型的字符串时要加上引号传递
阅读全文
摘要:radio中被选中的radio的值$('input[name="testradio"]:checked').val()$('input:radio:checked').val();$('input[@name="testradio"][checked]').val();$('input[name="...
阅读全文