...

View Full Version : javascript not working in firefox if doctype is there...



rhinodog8
08-25-2008, 02:01 AM
here this site: click here. (http://ryanh.110mb.com/test/test.html)

If i delete the doctype in the document the script works great in firefox 2,3.

it's works great in safari and opera with and without the doctype.

Whats going on? When I debug it in safari I get 0 errors, when i debug in firefox(firebug) I get 7 errors. What's going on?

rhinodog8
08-25-2008, 04:08 AM
ok i added <!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

that made firefox work, but it's the same as having no doctype anyway, so the real problem still exists...any idea on whats going on?

Arbitrator
08-25-2008, 05:57 AM
ok i added <!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

that made firefox work, but it's the same as having no doctype anyway, so the real problem still exists...any idea on whats going on?I havenít looked at the linked scripts, but have you tried using standardized methods for element references? It may be that this.menu.hide(); only works in quirks mode and that you need to use document.getElementById("menu").hide(); in the more standards‐compliant mode.

(Iím assuming that menu is meant to be an element reference by ID here. If itís a custom property, then this may have nothing to do with your issue. As I said, I didnít check the linked scripts.)

rhinodog8
08-25-2008, 06:03 AM
I haven’t looked at the linked scripts, but have you tried using standardized methods for element references? It may be that this.menu.hide(); only works in quirks mode and that you need to use document.getElementById("menu").hide(); in the more standards‐compliant mode.

(I’m assuming that menu is meant to be an element reference by ID here. If it’s a custom property, then this may have nothing to do with your issue. As I said, I didn’t check the linked scripts.)

yes i have tried the standard complaint way(works too, but i want the external js to work) but menu.hide(); is a function of the linked files(i think, i don't know too much js) it works in safari and opera...just not firefox...

I'm using newest version of the scriptaculous framwork/library(whichever it is).

and yes menu is a div layer with the id menu

Arbitrator
08-25-2008, 06:15 AM
yes i have tried the standard complaint way(works too, but i want the external js to work) but menu.hide(); is a function of the linked files(i think, i don't know too much js) it works in safari and opera...just not firefox...Well, the Firefox error console says this.menu is undefined; presumably, my mentioned fix would address that error. The console also says that the files slider.js, dragdrop.js, controls.js, and sound.js contain syntax errors; this is probably because they reference HTML documents instead of scripts. It also says that Prototype is not defined on line 73 in effects.js; I canít help you with that one but it might be related to your other script files being missing.

rhinodog8
08-25-2008, 06:28 AM
fixed it, i was using menu.hide(); but that was the old syntax format for the prototype framework. the new syntax is $('menu').hide();

no more errors at all. :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum