jQuery("does not exist ").data() throws exception
the following code from jQuery(1.4.2).fn.extend( { data : function {.........} } ):
- if ( typeof key === "undefined" && this.length ) {
- .....
- } else if ( typeof key === "object" ) {
- ......
- }
does not handle the situation when: key is undefined,and this.length===0,
next line of code:
- var parts = key.split(".");
cause the exception because key is undefined.
I think jQuery("does not exist ").data() should return undefined , instead of throwing an exception.