Bug Tracker

Modify

Ticket #10951 (closed bug: invalid)

Opened 19 months ago

Last modified 19 months ago

.val() raises cannot call method 'toLowerCase'

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

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

comment:1 Changed 19 months ago by sindresorhus

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to attributes

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

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.