Opened 12 years ago
Closed 12 years ago
#3453 closed enhancement (invalid)
append() etc functions to accept many arguments
Reported by: | antix | Owned by: | flesler |
---|---|---|---|
Priority: | major | Milestone: | 1.3 |
Component: | core | Version: | 1.2.6 |
Keywords: | multiple arguments, append, prepend, before, after | Cc: | |
Blocked by: | Blocking: |
Description
for example
var $container = $("<div />"); var $input = $("<input />"); var $okButton = $("<button>Ok</button>"); var $CancelButton = $("<button>Cancel</button>");
$container.append($input, $okButton, $cancelButton);
This way you have references to the content to add events etc and only one call to append()
It would also apply to prepend(), before() and after()
to maintain the ability to change these functions in the future you could let it accept an array
for example $container.append([$input, $okButton, $cancelButton]);
Change History (3)
comment:1 Changed 12 years ago by
Component: | unfilled → core |
---|---|
need: | Review → Patch |
Status: | new → assigned |
comment:2 Changed 12 years ago by
comment:3 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | assigned → closed |
Since this already works as desired I'll close the ticket.
Note: See
TracTickets for help on using
tickets.
I'm not clear on what the enhancement is here; you can already pass multiple arguments to append, prepend, etc. by virtue of the code in jQuery.clean that checks for array-like arguments. This has worked for a long time: