[jquery-dev] Re: Proposal: $("'text") for $(document.createTextNode(text))

2009-07-14 Thread John Resig
> So I guess you're saying that there shouldn't be a need to work with > text nodes, so no shortcut is necessary. Fair enough. Yeah, I'm open if some interesting use cases are proposed but for now I'm hesitant to add new syntax/parsing to $(...) for minor benefit. --John --~--~-~--~---

[jquery-dev] Re: Proposal: $("'text") for $(document.createTextNode(text))

2009-07-14 Thread David Flanagan
John Resig wrote: > Well, you could also do: > $("h1").prepend("§"); Yeah. I didn't mean to imply that my code was a serious use-case. Its just where I tripped myself up, thinking I could create a jQuery object that held "html" text that didn't happen to have any angle brackets in it :-). I

[jquery-dev] Re: Proposal: $("'text") for $(document.createTextNode(text))

2009-07-14 Thread John Resig
Well, you could also do: $("h1").prepend("§"); The reasoning behind handling selectors (and HTML) in $(...) and then later appending/prepending/etc. them into the document is that you can modify them in the interim. For example: $("Something").click(function(){ }).prependTo("div.section");