git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
32f688d
)
Added a fix for $("#noexist").attr("id") breaking.
author
John Resig
<jeresig@gmail.com>
Sat, 20 Jan 2007 03:58:57 +0000
(
03:58
+0000)
committer
John Resig
<jeresig@gmail.com>
Sat, 20 Jan 2007 03:58:57 +0000
(
03:58
+0000)
src/jquery/jquery.js
patch
|
blob
|
history
diff --git
a/src/jquery/jquery.js
b/src/jquery/jquery.js
index
085b576
..
4e82608
100644
(file)
--- a/
src/jquery/jquery.js
+++ b/
src/jquery/jquery.js
@@
-429,7
+429,7
@@
jQuery.fn = jQuery.prototype = {
// Look for the case where we're accessing a style value
if ( key.constructor == String )
if ( value == undefined )
- return jQuery[ type || "attr" ]( this[0], key );
+ return this.length && jQuery[ type || "attr" ]( this[0], key ) || undefined;
else {
obj = {};
obj[ key ] = value;