Querypath vs jQuery difference #33
Replies: 1 comment
-
Over the course of QueryPath's history, I've changed this a few times based In QueryPath 2.x, find() (and most traversing methods) was destructive. To In QueryPath 3.x, find() is non-destructive (works like jQuery) and The rationale for QP2's model was, as you guessed, memory management and With all of that said, it's been so long since I've spent any real time In fact, if you're interested, you may be able to weigh in on issue #112. Thanks! Matt |
Beta Was this translation helpful? Give feedback.
-
From querypath created by Jelle-S: technosophos/querypath#113
First of all, I love this library!
On the homepage of Querypath, the library is described as "jQuery for the server". And after using it a couple of times, that's exactly what it is!
But -and I don't think this is a real "issue"- I found a quite large difference with jQuery and I was wondering what the reason for this difference is (and I'm guessing it's performance and memory usage, but I just wanted to check to be sure).
Ok, so in jQuery you can do the following:
If you do the same in Querypath, the $body variable would change constantly:
The alternative would be to clone $this on each call and set the matched elements on the cloned object and then returning the clone in stead of $this. I can imagine how that could be a memory issue, but I'd just like your thoughts on this.
Beta Was this translation helpful? Give feedback.
All reactions