Conflicting scripts

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • webmaster@imca-int.com

    Conflicting scripts

    I am using two scripts (menus from milonic.com and a rotating news
    script we have used successfully for many years) on our website
    (www.imca-int.com) that independently work fine but together lead to
    the following error:

    Line: 20
    Error: 'pageX' is null or not an object

    While I can use scripts, I'm not tech-savvy enough to troubleshoot
    them - can anyone assist?

    Thanks,


    Adam
  • Stevo

    #2
    Re: Conflicting scripts

    webmaster@imca-int.com wrote:
    I am using two scripts (menus from milonic.com and a rotating news
    script we have used successfully for many years) on our website
    (www.imca-int.com) that independently work fine but together lead to
    the following error:
    Line: 20
    Error: 'pageX' is null or not an object
    >
    While I can use scripts, I'm not tech-savvy enough to troubleshoot
    them - can anyone assist?
    Some strange stuff going on there. In the file mmenudom.js there's a
    function called gMY which takes an object e as a parameter. Firstly,
    it's being called with no parameter, so whatever it tries to do on the
    object e is going to fail unless defensive coding first checks if e
    exists (which it doesn't). The statement that's failing is doing
    X_=e.pageX; which fails because e doesn't exist. Secondly, that
    particular line of code should only be run if(ns6), which I assume means
    if netscape6. That line was executing on my IE7. To stop the JS error I
    could tell you to check if e exists, but there's more wrong than that.
    Firstly, what's with the ns6 check, secondly, why is gMY being called
    without an e object. I'm assuming it's meant to be an event that should
    be passed.

    Comment

    • Evertjan.

      #3
      Re: Conflicting scripts

      wrote on 19 aug 2008 in comp.lang.javas cript:
      I am using two scripts (menus from milonic.com and a rotating news
      script we have used successfully for many years) on our website
      (www.imca-int.com) that independently work fine but together lead to
      the following error:
      >
      Line: 20
      Error: 'pageX' is null or not an object
      >
      While I can use scripts, I'm not tech-savvy enough to troubleshoot
      them - can anyone assist?
      They seem to make use of the same names in the global space,
      being bad scripting if you do not write scripts only for yourself.

      Our christal balls are offline or the indefinite future.

      Seems there are 4 solutions left:

      1- Learn Javascript. [a joyfull experience in itself]

      2- Hire a programmer, or bribe your next door wizkid.

      3- Do not use the two scripts on the same page.

      4- Use one of the two in an iframe. [needs 1 or 2]


      --
      Evertjan.
      The Netherlands.
      (Please change the x'es to dots in my emailaddress)

      Comment

      • Laser Lips

        #4
        Re: Conflicting scripts

        The reason your scripts are conflicting is indeed because of the
        points made above, but fundamentally because they share the use of the
        variable 'ns6'. They both try and set this variable to a value which
        they each understand, but they both have different values. So you’re
        bound to get inconsistencies . Try a global replace in on of the
        scripts of 'ns6' to 'milons6' or somthing and see if that helps. You
        may also want to look for other variables which use the same name.

        Graham...

        Comment

        • Laser Lips

          #5
          Re: Conflicting scripts

          Sorry Evertjan, just repeated what you said. :-(

          Comment

          • webmaster@imca-int.com

            #6
            Re: Conflicting scripts

            Thanks guys, much appreciated - have fixed the immediate problem of an
            IE script error coming up but will look at it in more detail in due
            course. Completely agree the best thing is to learn javascript and I
            hope to start on that in the near future, but needed a quicker fix
            than I could have managed.

            Cheers,


            Adam

            Comment

            Working...