Added onnload, onprogress and onerror events to xmlhttprequest