No, this is not possible using pure javascript. There are some techniques though involving using cookies from the server and continuous poll from the client. I've illustrated an example here:
Hide image using Javascript after controller action is complete MVC3