I think these are features new to jQuery 1.4, but I’m certain they are new to me.
With jQuery, unless I’m loading in data from an external resource, I usually only need to add a little HTML; a single node for instance.
Let’s look at the old, recent and new ways I’ve done and am doing this.
One problem here is that I don’t think its not compatible with both HTML and XHTML. Its also pretty ugly, too.
I read up on using jQuery to load CSS and found something like following. Better, huh?
This is what I think is new with jQuery 1.4+. Its the ability to create a new node internally, modify it, and then add it to the DOM. This might have been possible with jQuery 1.3, but I wasn’t aware of it. Regardless, its cool!
I’m not done with this yet. I’m planning to make it into a function with the CSS href as the argument.