Re: [jQuery] A little help with a 1.0 to 1.1 conversion
Works great, thanks for the help. One question: what's happening with .test()? The filter function returns the value from test() even though test() isn't defined? I'd like to read up on this, but don't really know what to look for in the docs. Adam Jörn Zaefferer wrote: Something like this: $([EMAIL PROTECTED]:not(.thickbox)).filter(function() { return !/thissite.net|othersites.org|moresites/.test(this.href); }).doIt(); You could omit the filtering in the selector and put it all into the filter funciton. -- Jörn Zaefferer http://bassistance.de -- View this message in context: http://www.nabble.com/A-little-help-with-a-1.0-to-1.1-conversion-tf3015403.html#a8428154 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] A little help with a 1.0 to 1.1 conversion
agent2026 schrieb: Works great, thanks for the help. One question: what's happening with .test()? The filter function returns the value from test() even though test() isn't defined? I'd like to read up on this, but don't really know what to look for in the docs. test() is a method of the regular expression: /thissite.net|othersites.org|moresites/.test(this.href); It basically says: Take the regular expression, defined by two slashes, and test it against the string passed as an argument. It returns a boolean true, when the string matches the regular expression. -- Jörn Zaefferer http://bassistance.de ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] A little help with a 1.0 to 1.1 conversion
Hi all, Reading up on the new release, I'm interested in the new feature of being able to pass comma-separated lists of selectors to the .not filter. Can this be applied to values? For example, I would like to convert this: $([EMAIL PROTECTED]:not([EMAIL PROTECTED]/]):not([EMAIL PROTECTED]/]):not([EMAIL PROTECTED]/]):not(.thickbox)).bind(click, function(){ return !window.open(this.href); }); to something like this: $([EMAIL PROTECTED]).not(thissite.net/, thatsite.com/, theothersite.com, .thickbox).bind(click, function(){ return !window.open(this.href); }); or $([EMAIL PROTECTED]).not([EMAIL PROTECTED]/],[EMAIL PROTECTED] thatsite.com/], [EMAIL PROTECTED], .thickbox).bind(click, function(){ return !window.open(this.href); }); I can't get it to work (obviously, or I wouldn't be here), so I'm guessing it's not possible. Just thought I'd check. Adam -- View this message in context: http://www.nabble.com/A-little-help-with-a-1.0-to-1.1-conversion-tf3015403.html#a8373809 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] A little help with a 1.0 to 1.1 conversion
agent2026 schrieb: Hi all, Reading up on the new release, I'm interested in the new feature of being able to pass comma-separated lists of selectors to the .not filter. Can this be applied to values? In that case, a custom filter would be a good choice. Something like this: $([EMAIL PROTECTED]:not(.thickbox)).filter(function() { return !/thissite.net|othersites.org|moresites/.test(this.href); }).doIt(); You could omit the filtering in the selector and put it all into the filter funciton. -- Jörn Zaefferer http://bassistance.de ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/