jQuery besides achieving such successes as being used by Google or Micro$soft also has ports to other major languages. Most of them are designed to be server-side what opens doors for new uses to the library.
jQuery ports to other languages:
Below some snippets showing each implementation in few lines.
PHP
foreach($doc['ul > li'] as $li) {
pq($li)->addClass('my-new-class');
->filter(':last')
->addClass('last-li');
}
$doc['ul > li:last']
->addClass('last-li');
Ruby
# load the RedHanded home page
doc = Hpricot(open("http://redhanded.hobix.com/index.html"))
# change the CSS class on links
(doc/"span.entryPermalink").set("class", "newLinks")
Perl
pQuery("http://google.com/search?q=pquery")
->find("h2")
->each(sub {
my $i = shift;
print $i + 1, ") ", pQuery($_)->text, "\n";
});
ActionScript
// add enterFrame event handler
$(stage).enterFrame(function(event:Event):void {
$("RoundRect").attr("color", function(...args):uint {
return Math.random() * 0xffffff;
});
});
List comes from phpQuery wiki page. Do you know any other ports ? Share it in comments.