Thank a lot, Joan!
On Mon, Jan 31, 2011 at 4:15 PM, Roan Kattouw <roan.kattouw(a)gmail.com>wrote;wrote:
2011/1/31 comp.wildsoft(a)gmail.com
<comp.wildsoft(a)gmail.com>om>:
Hi everyone,
I have 2 sites - I have installed mediawiki to one of my sites.
Now, can I use a search box on my another site to fetch results from
mediawiki (first site) and post on my second site?
Yes you can. Write some
JavaScript that sends an AJAX request to
http://yourwiki.com/w/api.php?action=query&list=search&srsearch=bla…
and displays the results. If the 2 sites are on different domains, you
will need to use JSONP callbacks; to do this, add
&format=json&callback=nameOfYourCallbackFunction to the URL and
include it as a <script> tag, or use jQuery's built-in AJAX facilities
to handle this for you (by adding &format=json&callback=? to the URL
instead and setting some parameter somewhere to JSONP; see the jQuery
documentation for details).
Roan Kattouw (Catrope)
_______________________________________________
Mediawiki-api mailing list
Mediawiki-api(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
_______________________________________________
Mediawiki-api mailing list
Mediawiki-api(a)lists.wikimedia.org