Skip to main content

Bug Tracker

Side navigation

#4559 closed bug (duplicate)

Opened April 20, 2009 12:25PM UTC

Closed April 24, 2009 03:04AM UTC

AREA tag can't be created with inline attributes in Firefox

Reported by: borg42 Owned by:
Priority: major Milestone: 1.4
Component: unfiled Version: 1.3.2
Keywords: area map firefox browser_dependent Cc:
Blocked by: Blocking:
Description

Eg. the following works in IE7 but not in FF3 (where its .length is 0):

$('<area alt="something" />')

Test case attached.

Using Windows XP SP2, IE 7.0.5730.13, FF 3.0.8, jQuery 1.3.2 min.

(Prio somewhere between major and minor...)

Attachments (1)
  • area1.html (2.0 KB) - added by borg42 April 20, 2009 12:25PM UTC.

    test case

Change History (5)

Changed April 21, 2009 02:02AM UTC by dmethvin comment:1

resolution: → duplicate
status: newclosed

This is a dup of #4484.

Changed April 21, 2009 10:04AM UTC by borg42 comment:2

resolution: duplicate
status: closedreopened

I believe this ticket is not a duplicate.

4484 says (if I got it right) that when you use html() for an element, you need to support a parameter that's valid html in a div.

4559 reports you can create an AREA tag (test 1 passes), but you can't support inline attributes to it (test 2-4 fails) - and only fails in FF.

If your argument was true, $('<area/>') and $('<li/>') would also fail as these are not valid html in the document/div scope - but they succeed, both in IE and in FF.

Changed April 23, 2009 02:07AM UTC by dmethvin comment:3

I agree they're not exactly the same but they seem to be pretty related. You are using XHTML 1.0 Transitional in your doc and that doctype says that AREA tags are only valid within a MAP. In particular,

  alert($("<div><br /></div>").html());    // "<br>"
  alert($("<div><area /></div>").html());  // ""
  alert($("<map><area /></map>").html());  // "<area>"

These aren't dependent on jQuery; try it with bare DOM, a div, and .innerHTML.

Like I said in #4484, it may be possible to do a fix in

jQuery.clean
(basically, detect AREA tags and wrap it in a map).

Changed April 23, 2009 11:46AM UTC by borg42 comment:4

Replying to [comment:3 dmethvin]:

I see your point, and I've RTFM; please set the ticket to duplicate and close it. :)

Please note that even though http://docs.jquery.com/Core/jQuery is adequately documented regarding this issue, http://docs.jquery.com/Html is not.

I'll open a new ticket with my feature request.

Changed April 24, 2009 03:04AM UTC by dmethvin comment:5

resolution: → duplicate
status: reopenedclosed