Closed Bug 448620 Opened 16 years ago Closed 16 years ago

html page with an img src="" causes to load the page twice (second time call seems to be executed inside the browser)

Categories

(Firefox :: General, defect)

x86
Windows Vista
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 225554

People

(Reporter: luisrinaldi, Unassigned)

References

()

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; es-ES; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; es-ES; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 To see the problem u should try with a server side script like php cos the second call to the page executes inside the browser. The following php code just call a function to append a file on disk with the text "Duplicated line" inside. It should write just 1 line every time you call the script but if you have the <img src=""> it will call twice the script. File: duplicate_call.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es"> <body> <img src="" /> <? file_put_contents("duplicate_result.log","Duplicated line\n",FILE_APPEND); ?> </body> </html> Reproducible: Always Steps to Reproduce: 1.Just copy the html code I left on details and save it to a php file 2.Upload the script to a webserver (u'll need write permissions on the same folder u upload the script) 3.Call the script from the web Actual Results: u'll notice every time u call the script it will insert two lines of code on duplicate_result.log instead of one. U can do the same test writing result to a database, u'll get duplicated records for each insert. Expected Results: If u remove the <img src=""> tag it will append just one line of code to the file. If u test with a database it will just insert one record on every call as expected. I was two hours dealing with a client development trying to understand why I was getting duplicated records executing just one INSERT on my script. I hope this help other people to void a headaches.
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.