Thank a lot, Joan!
On Mon, Jan 31, 2011 at 4:15 PM, Roan Kattouw roan.kattouw@gmail.comwrote:
2011/1/31 comp.wildsoft@gmail.com comp.wildsoft@gmail.com:
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=blah... 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@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api