Closed Bug 460832 Opened 16 years ago Closed 16 years ago

blank src property for img tag causes second page request/fetch

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 444931

People

(Reporter: kalendrinn, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.17) Gecko/20080829 Firefox/2.0.0.17
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.17) Gecko/20080829 Firefox/2.0.0.17

When specifying an image tag (<img></img>) on a page that has a blank src property, Firefox 2 AND 3 both request the page again prior to loading the images on the page.  This causes errors if the page is a script (such as PHP or ASP).

Reproducible: Always

Steps to Reproduce:
The code that was used to produce this is outlined below:

<html>
<?php
...some code
?>
<head>
	<script type="text/javascript" src="http://yui.yahooapis.com/combo?2.6.0/build/yahoo/yahoo-min.js&2.6.0/build/event/event-min.js&2.6.0/build/connection/connection-min.js"></script>
	<?php echo file_get_contents("http://some_path_to_script/index.php?wid={$web_id}&a=ads&page={$page}");?>
</head>
<body onload="if(ads) loadpage();">
This is the body and here is your message:<br /><br />
<div id="sbtop_ct" style="display:none;"><a id="sbtop_href" href=""><img id="sbtop" src="" border="0" /></a></div>
<div id="lbtop_ct" style="display:none;"><a id="lbtop_href" href=""><img id="lbtop" src="" border="0" /></a></div>
<div id="lstop_ct" style="display:none;"><a id="lstop_href" href=""><img id="lstop" src="" border="0" /></a></div>
<div id="lsbtm_ct" style="display:none;"><a id="lsbtm_href" href=""><img id="lsbtm" src="" border="0" /></a></div>
<div id="rstop_ct" style="display:none;"><a id="rstop_href" href=""><img id="rstop" src="" border="0" /></a></div>
<div id="rsbtm_ct" style="display:none;"><a id="rsbtm_href" href=""><img id="rsbtm" src="" border="0" /></a></div>
<div id="lbbtm_ct" style="display:none;"><a id="lbbtm_href" href=""><img id="lbbtm" src="" border="0" /></a></div>
<div id="sbbtm_ct" style="display:none;"><a id="sbbtm_href" href=""><img id="sbbtm" src="" border="0" /></a></div>
<div id="manure_ct" style="display:none;"><a id="manure_href" href=""><img id="manure" src="" border="0" /></a></div>
</body>
</html>


The PHP code in this generates the appropriate javascript to load the src property for the img tags...therefore the src does not need a default.  It should still give the same results if all PHP and Javascript is taken out.  I used Live HTTP Headers to see the fetches, and the PHP code called in the <head> block recorded page impressions.  View the code in a browser and you should see two page requests when viewing the headers.
Actual Results:  
Page is called twice causing scripts to be run twice.

Expected Results:  
Page should be called once, any blank src fields for img's should either show as a missing image or default built-in no-image image.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.