8bb390166ec865a5e08b9f4f14408972176fa39a
[mkws-moved-to-github.git] / examples / htdocs / mkws-widget-wikicat.js
1 mkws.registerWidgetType('wikicategories', function() {
2   $.ajax({
3     url: mkws.pazpar2_url() + "?command=wiki&query=" + this.config.autosearch,
4     context: this
5   })
6   .done(function(data) {
7     outstr = new XMLSerializer().serializeToString(data.getElementsByTagName("targetcategories").item(0));
8     this.node.html(outstr.replace("targetcategories", "ul").replace(/targetcategory/g, "li"));
9   });
10 });
11
12