Write an article to record some small experience in the web process. I plan to add this article as soon as I think of it. I will give myself a memo.
1. images are often displayed when we create html pages. Sometimes, for some reason, if the image is no longer there, there will be an x in the original image location, which will affect the appearance and layout. If it can be replaced with a default image, it will be better!
Of course, you can find a way to think of your ideas! Originally, I used java to verify whether the address of the image to be displayed has the resource to be changed. However ~ It was too difficult to find out. All of a sudden access to the page will not work. Check whether resources exist for each image. How can this problem be solved? Then I checked it online and there was an onerror event. This event is triggered when a resource loading error occurs!
Java code
After actual verification, the above Code is run in firefox4.0, chrome11, and ie6!
2. When we call the front-end page, we often use the firebug tool. However, what if some pages need to be debugged on ie? Ie does not have firebug.
Nonono and ie also have firebug. Try to add the following to the page source code, and refresh your current page to see the amazing effect.
Java code
<Script type = 'text/javascript 'src = 'HTTP: // getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'> </script>
Share this experience today. You can come up with new experiences in the future!
Author's "Technical Summary"