added onerror and onload callbacks examples to doc
Automatically rewritten for npm.