img Tag src= "" and Background-image:url (); Raise two request page bug

Source: Internet
Author: User

img Tag src= "" and Background-image:url (), raised two request page bug specific reason is that when the SRC attribute of an IMG object is an empty string (""), the browser considers this to be a default value, and the content of the value is the path of the current page. The browser will reload with the current path and use its contents as the binary content of the image and try to display it. For different browser tests, it is found that there is not a case where SRC or src is empty, and the test results are as follows.
Code Firefox IE6 IE7
will be loaded repeatedly will be loaded repeatedly will be loaded repeatedly
will be loaded repeatedly Normal Normal
Normal Normal Normal
If after the picture path later only assigns the value, must pay attention to this question, do not add src= "", or Background-image:url ();. (Only the IMG tag in IE has the above problem, while in Chrome, Firefox, Safari <script src= "" > and <link href= "" > will result in a new request)

img Tag src= "" and Background-image:url (); Raise two request page bug

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.