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