Bug Tracker

Modify

Ticket #8089 (closed bug: invalid)

Opened 2 years ago

Last modified 2 years ago

.attr(map): Quotes seem not to be optional

Reported by: anonymous Owned by:
Priority: low Milestone: 1.next
Component: attributes Version: 1.4.4
Keywords: Cc:
Blocking: Blocked by:

Description (last modified by jitter) (diff)

Don't know whether this is a bug in jquery, a bug in the api-documentation  http://api.jquery.com/attr/ or just a missing feature, but I thought it is worth reporting:

This does not work without quotes:

$mydialog.attr({
    role            : 'dialog',
    aria-hidden     : 'false',
    aria-labelledby : 'top'
});

Error in line aria-hidden: Missing : after property id

It works with quotes only:

$mydialog.attr({
    'role'            : 'dialog',
    'aria-hidden'     : 'false',
    'aria-labelledby' : 'top'
});

Change History

comment:1 Changed 2 years ago by Utkarsh

{aria-hidden : 'false'} is invalid javascript syntax. You need to enclose the key in quotes if they contain a -.

Last edited 2 years ago by Utkarsh (previous) (diff)

comment:2 Changed 2 years ago by jitter

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to attributes
  • Description modified (diff)

Thanks for taking the time to contribute to the jQuery project by writing a bug report.

After checking your report I conclude that this isn't a bug in jQuery but, as Utkarsh already pointed out, invalid javascript syntax.

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.