Jonas Bush

Blog.blog.blog.blog
posts - 16, comments - 161, trackbacks - 17

My Links

News

Archives

Post Categories

Image Galleries

General

Images being requested twice from the server

*taptaptap* Is this thing on?

 I ran into an interesting bug recently, where you would get 2 identical requests to the page you were visiting. I wasn't sure where this was coming from, so I poked around a bit. It turns out that having an <img /> tag on a page with an empty src attribute (like so: <img src="" />) causes that image tag to point to the containing page, causing the entire page to get requested again (causing any server-side code you may have to get executed again), but the response just gets thrown away, since the img tag is only expecting an image back from the server, not an HTML document.

The way around this is to remove the src attribute altogether, and you can still set the image source through javascript.

 

 

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Print | posted on Monday, July 13, 2009 9:55 AM | Filed Under [ SQL 2005 ]

Feedback

No comments posted yet.
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: