Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Aug 2008
    Location
    Colfax, California USA
    Posts
    64
    Thanks
    3
    Thanked 5 Times in 5 Posts

    javascript not working in firefox if doctype is there...

    here this site: click here.

    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?
    Last edited by rhinodog8; 08-25-2008 at 04:06 AM.

  • #2
    New Coder
    Join Date
    Aug 2008
    Location
    Colfax, California USA
    Posts
    64
    Thanks
    3
    Thanked 5 Times in 5 Posts
    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?

  • #3
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,302
    Thanks
    28
    Thanked 276 Times in 270 Posts
    Quote Originally Posted by rhinodog8 View Post
    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.)
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #4
    New Coder
    Join Date
    Aug 2008
    Location
    Colfax, California USA
    Posts
    64
    Thanks
    3
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by Arbitrator View Post
    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

  • #5
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,302
    Thanks
    28
    Thanked 276 Times in 270 Posts
    Quote Originally Posted by rhinodog8 View Post
    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.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #6
    New Coder
    Join Date
    Aug 2008
    Location
    Colfax, California USA
    Posts
    64
    Thanks
    3
    Thanked 5 Times in 5 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •