added onerror and onload callbacks examples to doc