Small Html experience

Source: Internet
Author: User

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"
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.