Bug Tracker

Opened 8 years ago

Closed 8 years ago

#10951 closed bug (invalid)

.val() raises cannot call method 'toLowerCase'

Reported by: barretojay@… Owned by:
Priority: low Milestone: None
Component: attributes Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:

Description

If I ask for the value of a regular object like $({test: 0}).val() should it raise:

TypeError: Cannot call method 'toLowerCase' of undefined

or should it return say null?

Change History (1)

comment:1 Changed 8 years ago by sindresorhus

Component: unfiledattributes
Priority: undecidedlow
Resolution: invalid
Status: newclosed

From the docs:

At present, the only operations supported on plain JavaScript objects wrapped in jQuery are: .data(),.prop(),.bind(), .unbind(),.trigger() and .triggerHandler(). The use of .data() (or any method requiring .data()) on a plain object will result in a new property on the object called jQuery{randomNumber} (eg. jQuery123456789).

Note: See TracTickets for help on using tickets.