Bug Tracker

Modify

Ticket #4951 (closed bug: invalid)

Opened 4 years ago

Last modified 15 months ago

$("<div id='a'>").appendTo("#bar") doesn't work in chrome 2.0

Reported by: Xavi Owned by:
Priority: minor Milestone: 1.3.2
Component: core Version: 1.3.2
Keywords: chrome, xhtml Cc:
Blocking: Blocked by:

Description

$("<div id='foo'>").text("test").appendTo("#bar") does not work on "application/xhtml+xml" pages in chrome 2.0.172.33.

However $("<div id='foo'/>").text("test").appendTo("#bar") work just fine.

Change History

comment:1 Changed 4 years ago by jerone

The second one is the correct one. You should alwasy add the closing slash (/).

comment:2 Changed 3 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid
  • Component changed from unfiled to core

As jerone said, the html inside the $() is invalid markup, it either needs a closing slash or a closing tag. The documentation is clear on this.

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.