Bug Tracker

Modify

Ticket #9188 (closed enhancement: wontfix)

Opened 2 years ago

Last modified 2 years ago

Let .html() take multiple arguments like append()

Reported by: asjquery@… Owned by:
Priority: undecided Milestone: 1.next
Component: unfiled Version: 1.6
Keywords: Cc:
Blocking: Blocked by:

Description

Let .html() take multiple arguments like append() does. Obviously I can use append() or prepend() after the html() call, but it's probably more efficient to do it in one function.

I can't simply string-append the html since it's jquery objects that I am inserting, not pure html.

Change History

comment:1 Changed 2 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to wontfix

Since .html() is intended for string html arguments it seems strange to use it this way. When the args are strings you can just append them together, so allowing multiple strings doesn't seem to offer anything. You can always just .append(jq1, jq2, jq3) if you have multiple jQuery objects.

probably more efficient

Internally .html() often uses .empty().append() so I doubt it is slower, but you could write some jsperf.com tests.

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.