Yesterday, after seeing this thread, I started work on a jQuery Lint
script. You can see it here: http://github.com/jamespadolsey/jQuery-Lint
It does a few basic checks - argument signatures being the main one.
It also tries to combat lack-of-caching with selections, and it will
warn you when
I've been looking into jQuery.fragments and have a couple of
suggestions.
It'd be useful, I think, if jQuery.fragments could be used to store
basic DOM nodes as well, for example (currently it only stores
fragments):
jQuery.fragments['div/'] = document.createElement('div');
...
a bit hesitant landing a change like this, wholesale -
mostly because we're looking at better templating solutions for after
1.4 and this seems hacky, at best.
--John
On Mon, Jan 4, 2010 at 7:50 AM, James Padolsey
jamespadol...@googlemail.com wrote:
I've been looking
What? Never heard of that before...
On Dec 8, 2:28 pm, DBJDBJ dbj...@gmail.com wrote:
Also please be sure to have jquery attribute present, like so:
script scr=jquery-1.3.2.min.js type=text/javascript
jquery=1.3.2 /script
This switches on, undocumented jQuery event handling. And also
This could be fixed by checking arguments.length.
---
set = arguments.length 1;
---
On Oct 23, 5:12 pm, Jonathan Sharp jdsh...@outwestmedia.com wrote:
Given the following:
$.fn.foo = function() { alert('foo'); return this };
$( [] ).attr('id', bar).foo();
.foo() is never executed
This is just the way jQuery works. All getters only return the first
result.
To avoid this you could use jQuery.map:
var values = jQuery.map( $('input.file_attachment'), function(input){
return $(input).val();
});
If you think you'll want this functionality more than once then I'd
suggest
Thanks for your reply John. :)
On Aug 14, 1:24 pm, John Resig jere...@gmail.com wrote:
That can't be true, right? It doesn't search the whole doc.
Correct, it only searches the limited sub-set.
The context property may be document but .myClass is only
searched for within #myContainer,
Would this be a possibility?
It would be nice if it worked like JavaScript's Array methods, whereby
passing a negative number indicates a position from the end of the
array. So, with the following collection:
[a/, div/, span/]
eq(-1) would return span/, eq(-2) would return div/...
This could
I think you mean /^(PUT|POST)$/
Your regex will match PUT at the start of a string or POST at the end
of one.
On 14 Aug, 09:16, George george.jqu...@softwareunity.com wrote:
FWIW would it be clearer to write the regex like this? It's the same
number of characters:
xhr.send(
Back in June, Brandon wrote an enlightening article about the
misunderstood context parameter.
Read it here:
http://brandonaaron.net/blog/2009/06/24/understanding-the-context-in-jquery
Most of it makes sense to me now but I'm still a little confused about
some of the assertions made as a
Added http://dev.jquery.com/ticket/5050
Thanks guys!
On 14 Aug, 13:19, John Resig jere...@gmail.com wrote:
I don't see why not - we already support .get(-1), .eq(-1) makes sense. Want
to file a feature ticket for it?
--John
On Fri, Aug 14, 2009 at 2:34 AM, James Padolsey
jamespadol
instanceof won't worik because a function within an iframe won't have
the same constructor as one outside of it.
On Aug 4, 10:04 am, DBJDBJ dbj...@gmail.com wrote:
Worryingly in IE8 this is the state of play :
// IE8
Object.prototype.toString(Error.valueOf)
/* [object Object] */
typeof
Around line ~3100 (3321 in the latest nightly) you're binding the
unload event so as to prevent any memory leaks in our favourite
browser (IE). Unfortunately the presence of an unload handler
disables some caching techniques used in other browsers (see
Checking the constructor is a bad idea; if you try checking the
constructor of an object within an iframe it won't have the same
constructor as an object outside of the iframe. I think this'll do
what's required:
function isObj(o){ return Object.prototype.toString.call(o) ===
'[object Object]' }
Just a thought; this would be quite useful IMO:
var paras = $('p'), uls = $('ul');
if (paras uls) {
// ...
}
I know it's not quite as readable (or as semantic) as:
if (paras.length uls.length) {
// ...
}
but still, it's one of those things that may as well be added, just
for the few
Try the change event, it's more reliable:
$('select').bind('change', function(){
/* ... */
});
On Jun 28, 10:35 am, Nesto katapultstolpil...@gmail.com wrote:
It seems there are issues with binding events to option elements, bind
('click') doesn't work on anything. live('click') works for
I'm pretty sure this has nothing to do with the live() event. It's
probably the selector itself that is killing the browser. Are you
looking for HREFs that start with #javascript? ... If so, why not just
use [href^=#javascript] ...
On Jun 18, 6:18 am, pbcomm pbc...@gmail.com wrote:
Trying to
I think it'd be useful to be able to pass a number to clone().
Example of usage:
jQuery('ul').append(
jQuery('li/').clone(50)
);
What do you think? Useful or not?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
18 matches
Mail list logo