PDA

View Full Version : Internet Explorer vs Mozilla Firefox


steviedifranco
03-07-2005, 08:42 AM
With the release of Mozilla Firefox recently, I've checked some websites I've done only to find that it looks entirely different in IE and MFF. I've noticed that some DHTML events don't work in MFF for some odd reason. Has anyone had a similar experience?

Here's an example of what I'm talking about....

www.ohioconnect.net/~clevelan/buy.php

There are 2 simple scripts I've made on that page. They work just fine in IE, but they don't work at all in MFF. Does anyone know what's up with it? The navigation doesn't work right in MFF and the interactive map doesn't work at all in MFF. Any help would be appreciated. Thanks.

Sardtok
03-07-2005, 10:15 AM
Have you checked your javascript advanced settings in FF?
There are certain restrictions set as default.
And maybe you are using jscript specific commands (jscript = Microsoft's javascript like language which has most javascript functions and a bunch of IE only functions).
You should follow either the ECMAscript standard, which is basically a slightly older version of the latest javascript releases (that's Netscape's javascript, which is javascript and not jscript), or you should make sure you follow Netscape's javascript standards.

steviedifranco
03-07-2005, 10:43 AM
Where do I find documentation on those standards? I don't know too much about javascript, and in fact all it really is on that page is DHTML. Look at the source...its only 'onmouseover' and 'onmouseout', nothin fancy.

Sardtok
03-07-2005, 02:38 PM
Well,
the ecmascript standard is done by ecma (the european equivalent of ANSI),
latest ecmascript standard:
http://www.ecma-international.org/publications/standards/Ecma-357.htm
Although the ecma 262 seems to be the only one that there is full support for yet,
easy to get to from there.

http://www.mozilla.org/js/

And no, even if something happens on mouseup, doesn't mean that the function called is necessarily supported...
Also check your javascript console under tools in FF, it has links to W3C's pages on errors associated with your page.
And there are quite a few...
Remember:
IE allows you to do all kinds of errors, and it won't tell you, although sometimes, it will show a tiny warning sign in the lower left corner (doesn't do so on your page though).

Edit:
Whoops,
looked like it wasn't your page, but some flight company's pages I'd been to to book a ticket that were not following ecma standards according to the console.

Marble
03-09-2005, 07:59 PM
try changing:

document.all <--- IE specific code (with flaky support of different browsers)

to:

document.getElementById <--- cross platform version

steviedifranco
03-10-2005, 05:55 AM
Marble,

That fixed my navigation problems which has been a HUGE problem for me. Thank you so much!

That 'How To Buy' page still doesn't work though. Any ideas on that? I messed around with the script a little and I still can't figure it out. Thanks.

Marble
03-10-2005, 09:01 PM
I haven't spent much time with javascript and browser compatability, but what I do is pick out functions and classes that are used (for instance document.all ) and then search google for firefox and document.all, for example. It will give you some useful info though and also search Mozillas site. They have areas for referencing correct w3c DOM and common IE only javascript that is widely used...