Javascript not working with Safari/Firefox (Mac)

Discussion in 'Javascript' started by JB, Nov 6, 2004.

  1. JB

    JB Guest

    JB, Nov 6, 2004
    #1
    1. Advertisements

  2. JB

    VK Guest

    Change:
    ....
    if (document.all) {
    menu.innerHTML=menucontent
    }
    ....

    to

    ....
    if ((document.getElementById)||(document.all)) {
    menu.innerHTML=menucontent
    }
    ....

    (Actually document.all is not needed at all, but let's keep the code as
    close as possible to the the unknown author's original).

    This is a war time script (Great Browsers' War), and its way to determine
    platforms is obsolete for 3-4 years at least.
     
    VK, Nov 6, 2004
    #2
    1. Advertisements

  3. JB

    JB Guest


    Thanks!
     
    JB, Nov 6, 2004
    #3
  4. JB

    Fred Oz Guest

    The page highlights the folly of making your page utterly dependent on
    JavaScript. One small error or incompatibility and the entire page is
    useless.

    I would be much better to write the contents of the page as HTML, then
    use JavaScript to modify it, that way users without JS or whose
    browsers are incompatible can still use the page.

    Fred.
     
    Fred Oz, Nov 7, 2004
    #4
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.