Skip to main content

Bug Tracker

Side navigation

#10951 closed bug (invalid)

Opened December 05, 2011 05:10PM UTC

Closed December 05, 2011 05:35PM UTC

.val() raises cannot call method 'toLowerCase'

Reported by: barretojay@gmail.com 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?

Attachments (0)
Change History (1)

Changed December 05, 2011 05:35PM UTC by sindresorhus comment:1

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).