views:

78

answers:

4
<a href="http://twitter.com/theusername"&gt;Click&lt;/a&gt;

For some reason, it pops up the download instead of going to the page.

Edit: When I close IE8 and open it again, it works again. Then, the 2nd time, it won't work. I have to close and open IE8 each time for it to work.

+2  A: 

Proper answer:

As David and DN have said, the reason why IE is trying to download this is that it doesn't recognise application/xhtml+xml. Without a recognised content-type, it will normally fall back on extension, but as this URL contains no extension, it falls back to downloading as "Unknown File Type".


Old answer for posterity

That's a link to m.twitter.com, the mobile version. The data is being served as xhtml+xml, so I don't know why IE would try to download it.

Edit: There is no file extension (theusername isn't a directory with an index.htm in it, it's just a file). I think IE works out content type by extension, so if a file has no extension its type is "Unknown File Type", and it prompts to download.

Skilldrick
IE would try to download it because it doesn't support XHTML. (And it doesn't 'work out the content type by extension', it just **sometimes** lets something that looks like a file extension override the content-type header).
David Dorward
File extension is unimportant in deciding whether to display or download, it is the `Content-Type` that counts; and David's right, IE won't display pure-XML-XHTML. But I don't see a link to `m.twitter.com`, personally. [edit: huh, removed in question edit... are you still seeing broken behaviour on the main Twitter URL? You shouldn't.]
bobince
Check the revision history. He changed the link.
D_N
@bobince - I went to m.twitter.com in IE6 and had this behaviour. After that, I think IE gets broken, because the same behaviour appears on www.twitter.com. Visiting www.twitter.com in a fresh browser doesn't display the same behaviour.
Skilldrick
IE can lick my balls. thanks everyone.
TIMEX
Unfortunately, IE does not support W3C DOM Level 3 Gonad Osculation features.
bobince
@bobince Nice :)
Skilldrick
@Skilldrick +1 for "I think that IE is broken"
Adam Kiss
A: 

I suspect it's because of the response header that Twitter is sending back. I'm not sure exactly what makes IE do that; there's a typo in the "Content-type" line, for one thing.

Pointy
I wonder whether that content-type typo is it...
Skilldrick
+1  A: 

Wow, that's odddd. Do you mean to be linking to the mobile site? I suspect there's some browser oddity there, on Twitter or IE8's side I'm not sure.

Following up on Skilldrick's reply, though, IE apparently still doesn't support application/xhtml+xml. That's very likely why--it doesn't support it, recognizes it's a file, and so asks you to download it.

D_N
@DN Thanks - I've incorporated your point into my answer.
Skilldrick
+3  A: 

As already surmised, this problem is due to Twitter returning its mobile-targeted pages with Content-Type: application/xhtml+xml instead of the usual desktop-browser-targeted text/html. IE is infamous for being the browser that cannot handle application/xhtml+xml, so it's expected that it won't be able to access the mobile site properly.

The real problem is that Twitter is setting a session cookie (_twitter_sess) across all of twitter.com, and recording in your session whether you've ever attempted to access m.twitter.com before. If you have, all future access to [www.]twitter.com will be redirected to the mobile site. Goodness knows what that's supposed to achieve, but it nicely screws IE over, and it's amusingly exploitable in that if you can persuade an IE user to visit a page where you include content from m.twitter.com, you can break all their use of Twitter until they close the browser.

One would hope they'd fix it (and their inconsistent <meta> too whilst they're at it).

bobince
It would make sense do so in case a mobile browser is not detected properly, so the user can still indicate they wanted the mobile version. Aye?
D_N
Aha, that explains it.
Skilldrick