Hotspot login with Ajax/Jsonp ... Possible??

As far as I understand, when we host a login page on external server from there we post the form to http://x.x.x.x/login which then redirects to appropriate html page.

So, what I’m trying to do is, make the login request via ajax/jsonp and get the response in son format. Is it possible in any way??

Thank you,

Rahul.