Fixed an issue with #id expression parsing, an issue with formatting, and removed the try{} block from around event firings.

This commit is contained in:
John Resig 2006-06-11 18:12:46 +00:00
parent a457262ef5
commit b5256caee6

16
jquery/jquery.js vendored
View file

@ -318,6 +318,16 @@ function $(a,c) {
return self; return self;
} }
(function(){
var b = navigator.userAgent.toLowerCase();
$.browser =
( /safari/.test(b) && "safari" ) ||
( /opera/.test(b) && "opera" ) ||
( /msie/.test(b) && "msie" ) ||
( !/compatible/.test(b) && "mozilla" ) ||
"other";
})();
$.apply = function(o,f,a) { $.apply = function(o,f,a) {
a = a || []; a = a || [];
if ( f.apply ) { if ( f.apply ) {
@ -514,7 +524,7 @@ $.Select = function( t, context ) {
if ( m[1] == "#" ) { // Ummm, should make this work in all XML docs if ( m[1] == "#" ) { // Ummm, should make this work in all XML docs
var oid = document.getElementById(m[2]); var oid = document.getElementById(m[2]);
r = oid ? [oid] : []; r = oid ? [oid] : [];
t = t.replace( re, "" ); t = t.replace( re2, "" );
} else { } else {
if ( m[2] === "" || m[1] == "." ) { m[2] = "*"; } if ( m[2] === "" || m[1] == "." ) { m[2] = "*"; }
@ -545,10 +555,12 @@ $.Select = function( t, context ) {
} }
} }
if ( t ) {
var val = $.filter(t,r); var val = $.filter(t,r);
ret = r = val.r; ret = r = val.r;
t = $.cleanSpaces(val.t); t = $.cleanSpaces(val.t);
} }
}
if ( ret && ret[0] == context ) { ret.shift(); } if ( ret && ret[0] == context ) { ret.shift(); }
done = $.merge( done, ret ); done = $.merge( done, ret );
@ -789,7 +801,6 @@ $.event.handle = function(event) {
} }
for ( var i = 0; i < handlers.length; i++ ) { for ( var i = 0; i < handlers.length; i++ ) {
try {
if ( handlers[i].constructor == Function ) { if ( handlers[i].constructor == Function ) {
this.$$handleEvent = handlers[i]; this.$$handleEvent = handlers[i];
if (this.$$handleEvent(event) === false) { if (this.$$handleEvent(event) === false) {
@ -798,7 +809,6 @@ $.event.handle = function(event) {
returnValue = false; returnValue = false;
} }
} }
} catch(e){}
} }
return returnValue; return returnValue;
}; };