Fixed AJAX http basic auth issue and adding location to set_result call from javascript.