With AJAX, you can read the downloaded file, but with pure javascript it is not possible, because javascript works on the client side, not on the server side.
if you are going to use jquery since an Ajax call might be like this
$.ajax({ url: "test.html", context: document.body, success: function(){ $(this).addClass("done"); } });
source share