At the point of doing document.getElementById(t), you might as well just
return that since that's all jQuery is going to do anyways. You might
consider something like (only tested on FF2/win32):
jQuery.fn._find = jQuery.fn.find;
jQuery.fn.find = function(t, context) {
if (typeof t == 'string' && document.getElementById(/^\w+/.exec(t)))
t = '#' + t;
return this._find(t, context);
}
Even that still breaks some jQuery functionality, but at least $("#someId
span") or $("#someId:visible") type things will work.
--Erik
On 1/11/07, Mike Alsup <[EMAIL PROTECTED]> wrote:
Maybe this one make more sense:
jQuery.fn._find = jQuery.fn.find;
jQuery.fn.find = function(t, context) {
if (typeof t == 'string' && document.getElementById(t))
t = '#' + t;
return this._find(t, context);
}
It's sort of a "Prototype conversion" plugin I suppose. And probably
useful for people like me that forget the '#' a lot. I think the only
problem you'd have is if you have ids like 'div' or 'span', etc.
Mike
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/