jquery-lint

Using native code functions as JavaScript objects in WebKit

有些话、适合烂在心里 提交于 2019-12-06 10:26:28
问题 I'm unable to use native code functions as JavaScript objects in WebKit-based browsers. Is it impossible to alias these functions directly? This is easiest to explain by example, so here is what I am running in the Developer Tools console: console.warn; // Outputs: // function warn() { // [native code] // } console.warn("console.warn"); // Outputs: "console.warn" var _c = console; _c.warn("_c.warn"); // Outputs: "_c.warn" var _w = console.warn; _w("_w"); // Outputs: "TypeError: Type error" on

JQuery Lint says: “You've used the same selector more than once.” I don't think I have

只愿长相守 提交于 2019-12-06 09:47:58
问题 Here's my problem child: jQuery(document).ready(function() { var a = jQuery('img[title*="after"]'); a.parents('dl.gallery-item').addClass('after'); a.addClass('after'); var b = jQuery('img[title*="before"]'); b.parents('dl.gallery-item').addClass('before'); b.addClass('before'); //the following gives each image a 'name' attribute based on the caption, collapsed. jQuery('img').each(function() { var f = jQuery(this).parents('dl.gallery-item').find('dd').text(); var f = f.replace(/\s/g,'');

JQuery Lint says: “You've used the same selector more than once.” I don't think I have

核能气质少年 提交于 2019-12-04 17:36:03
Here's my problem child: jQuery(document).ready(function() { var a = jQuery('img[title*="after"]'); a.parents('dl.gallery-item').addClass('after'); a.addClass('after'); var b = jQuery('img[title*="before"]'); b.parents('dl.gallery-item').addClass('before'); b.addClass('before'); //the following gives each image a 'name' attribute based on the caption, collapsed. jQuery('img').each(function() { var f = jQuery(this).parents('dl.gallery-item').find('dd').text(); var f = f.replace(/\s/g,''); jQuery(this).attr('name', f); }); //the following takes each 'name' attribute, finds the before, and sticks