Http Basic Authentication and AJAX

Does anyone know how to make AJAX calls to admin name spaced controllers that requires http basic authentication? TIA.

If you already have HTTP auth working, the ajax calls should just
work. If the client is not authenticated, a popup should appear asking
him to give his credentials.

The HTTP basic authentication is already working. But AJAX calls to those controller fails. Any pointers is appreciated. Thanks.

http://coderseye.com/2007/how-to-do-http-basic-auth-in-ajax.html