Whoosh! That *IS* strange!
It's not the version of IE that is different, is it? That is, when you view the Sharepoint-hosted code are you using IE8 but when you view your own site your are using IE9? Or something like that?
I don't see how the server could make any difference to HTML and JS code.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.