Web browsers differences: Difference between revisions

From Elvanör's Technical Wiki
Jump to navigation Jump to search
No edit summary
Line 2: Line 2:


* Debugging JavaScript on IE is a lot harder than on FF. The best is to install Firebug Lite. However, you must not use console.log() before the window is loaded (else you'll get a very annoying fatal error saying IE cannot open the page).
* Debugging JavaScript on IE is a lot harder than on FF. The best is to install Firebug Lite. However, you must not use console.log() before the window is loaded (else you'll get a very annoying fatal error saying IE cannot open the page).
* Only use Prototype JS code or you'll run into troubles (mainly because all elements should be extended Prototype elements to ensure cross-browser behavior).
* Only use Prototype JS code or you'll run into troubles (mainly because all elements should be extended Prototype elements to ensure cross-browser behavior).
 
* IE caches *a lot*. In particular Ajax requests can be cached! Be sure to put some caching directives on the server side, else IE simply won't hit your server again. It'll use the cached version.
* IE 7 automatically adds margins to forms. You can override that behavior with CSS.
* IE 7 automatically adds margins to forms. You can override that behavior with CSS.
* IE does not properly support CSS comments; multiple CSS comments on one line, with an actual property / value set, confuses the poor piece of crap.
* IE seems to have a bug when multiple floated divs are present on a container, with their widths in percentage. If the percentage amounts to exactly one hundred (100%), then it will not render correctly. To fix this, you can just make the widths go only to 99% if possible.
* IE does not like absolute positioning on anchor elements or images; but you can usually fix it by wrapping in a div or span.
* text-align: center can also cause misbehavior, usually you can fix it by only applying this property to a subelement.


== Opera ==
== Opera ==

Revision as of 21:22, 17 March 2008

Internet Explorer

  • Debugging JavaScript on IE is a lot harder than on FF. The best is to install Firebug Lite. However, you must not use console.log() before the window is loaded (else you'll get a very annoying fatal error saying IE cannot open the page).
  • Only use Prototype JS code or you'll run into troubles (mainly because all elements should be extended Prototype elements to ensure cross-browser behavior).
  • IE caches *a lot*. In particular Ajax requests can be cached! Be sure to put some caching directives on the server side, else IE simply won't hit your server again. It'll use the cached version.
  • IE 7 automatically adds margins to forms. You can override that behavior with CSS.
  • IE does not properly support CSS comments; multiple CSS comments on one line, with an actual property / value set, confuses the poor piece of crap.
  • IE seems to have a bug when multiple floated divs are present on a container, with their widths in percentage. If the percentage amounts to exactly one hundred (100%), then it will not render correctly. To fix this, you can just make the widths go only to 99% if possible.
  • IE does not like absolute positioning on anchor elements or images; but you can usually fix it by wrapping in a div or span.
  • text-align: center can also cause misbehavior, usually you can fix it by only applying this property to a subelement.

Opera

  • location.hash is bugged when the hash contains a question mark. Update: this seems to have been fixed.
  • myForm.readAttribute("action") behaves differently in Opera, as it adds the hostname before (which is bad!). The bug was apparently fixed in Opera 9.50 (see this bug reference).
  • Opera automatically adds margins to forms.
  • Opera does not fire the "load" event on an newly created image, which has already been downloaded (eg, whose source corresponds to an already fetched element). This is probably a bug that hopefully will be fixed.