Use an event handler with XHMLHttpRequest