| function print(message, color) |
| var paragraph = document.createElement("div"); |
| paragraph.appendChild(document.createTextNode(message)); |
| paragraph.style.fontFamily = "monospace"; |
| paragraph.style.color = color; |
| document.getElementById("console").appendChild(paragraph); |
| testRunner.waitUntilDone(); |
| var img1 = document.getElementById('img1'); |
| img1.onerror = function (error) { |
| print("PASS: caught image load error: " + error, "green"); |
| img1.src = "invalidinvalid.jpg"; |
| <p>This page tests setting onerror handlers through the DOM. If it passes, you will |
| see "PASS" message below.</p> |
| <img style="display:none" id="img1"> |