Login to a Mediawiki without leaving your page
From Organic Design wiki
The wiki must have jquery.js linked to. From 1.16 onwards this comes with the MW package. Also dropclick.js if you want to use this fancy dropdown.
This code was written for a 1.16 skin. It uses ajax and api.php.
There are two parts, the javascript in the head and a form in the body.