Bug Tracker

Opened 6 years ago

Closed 6 years ago

#13380 closed bug (invalid)

problem of attr

Reported by: fuweichin@… Owned by: fuweichin@…
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.2
Keywords: Cc:
Blocked by: Blocking:

Description

jQuery attr returns undefined while UA implementations return empty string

$("html").attr("lang") undefined $("html")[0].lang ""

var locale=$("html").attr("lang").replace("-","_"); TypeError: Cannot call method 'replace' of undefined

and I have to write it like this: var locale=$("html")[0].lang.replace("-","_");

Tested in Chrome/24.0.1312.57

Bug found in v1.8.2 while it is okay in v1.4.2

Change History (2)

comment:1 Changed 6 years ago by dmethvin

Owner: set to fuweichin@…
Status: newpending

So if there is no lang attribute on the html element it should return undefined. Can you provide a test case on jsfiddle.net that shows what the problem is?

comment:2 Changed 6 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.