Conflicting scripts

Discussion in 'Javascript' started by webmaster@imca-int.com, Aug 19, 2008.

  1. Guest

    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
     
    , Aug 19, 2008
    #1
    1. Advertising

  2. Stevo Guest

    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.
     
    Stevo, Aug 19, 2008
    #2
    1. Advertising

  3. Evertjan. Guest

    wrote on 19 aug 2008 in comp.lang.javascript:

    > 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)
     
    Evertjan., Aug 19, 2008
    #3
  4. Laser Lips Guest

    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...
     
    Laser Lips, Aug 19, 2008
    #4
  5. Laser Lips Guest

    Sorry Evertjan, just repeated what you said. :-(
     
    Laser Lips, Aug 19, 2008
    #5
  6. Guest

    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
     
    , Aug 19, 2008
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jan Danielsson
    Replies:
    8
    Views:
    634
    Mike Meyer
    Jul 22, 2005
  2. Jp Calderone
    Replies:
    0
    Views:
    464
    Jp Calderone
    Jul 21, 2005
  3. davidj411
    Replies:
    0
    Views:
    528
    davidj411
    Jun 27, 2008
  4. Julia Briggs
    Replies:
    1
    Views:
    71
    Chris
    Dec 15, 2003
  5. Replies:
    13
    Views:
    540
    Anno Siegel
    Sep 10, 2007
Loading...

Share This Page