i wonder if below, generating content the jQuery 1.4 way
$("<div />", {
"class": "loading",
"html": "some html code here"
}).appendTo("#elem");
or the normal "easy" way is better. any performance or benefits from either?
$("#elem").append("some html code here");
oh i just thought of 1 benefit of the 1st, i can add event handlers. is this the only benefit?
var a = $("<a />", { href: "#", click: function() {}, text: "link text"});
on a side note, if i want to add the above link in the middle of some content i will do ...
var a = $("<a />", { href: "#", click: function() {}, text: "link text"});
var div = $("<div />", { html: "here is some content " + a.html() + " here is more html" });
right?