Skip to content
May 28, 2011 / pauldundon

Unexpected GETs in Chrome / Safari using ImageButtons

The problem: You have a web page using ImageButtons or other <input type=”image”> controls. This works in IE and Firefox, but generates unexpected GET requests for your page in Chrome and Safari. If you are using ASP.NET webforms, this will appear as a non-postback request.

Possible cause: The src attribute is not set on the input tag at load time (eg, you are setting it in Javascript). In WebKit browsers, this is interpreted as a relative URL so a GET request is made to the host page.

Solution: ensure the src attribute is set in the HTML delivered to the browser, before your script runs.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: