Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Conflicting scripts

Reply
Thread Tools

Conflicting scripts

 
 
webmaster@imca-int.com
Guest
Posts: n/a
 
      08-19-2008
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
 
Reply With Quote
 
 
 
 
Stevo
Guest
Posts: n/a
 
      08-19-2008
http://www.velocityreviews.com/forums/(E-Mail Removed) 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.
 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      08-19-2008
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)
 
Reply With Quote
 
Laser Lips
Guest
Posts: n/a
 
      08-19-2008
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...
 
Reply With Quote
 
Laser Lips
Guest
Posts: n/a
 
      08-19-2008
Sorry Evertjan, just repeated what you said.
 
Reply With Quote
 
webmaster@imca-int.com
Guest
Posts: n/a
 
      08-19-2008
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Python Scripts with IIS - ASP or Python-based CGI scripts withIIS - which makes more sense? davidj411 Python 0 06-27-2008 04:38 PM
What is required for perl scripts to run correct when launched from rc scripts on HPUX 11? deanjones7@gmail.com Perl Misc 13 09-10-2007 11:58 AM
Stupid question: Making scripts python-scripts Jan Danielsson Python 8 07-22-2005 12:20 AM
Re: Stupid question: Making scripts python-scripts Jp Calderone Python 0 07-21-2005 02:38 PM
I have these two short conflicting scripts -- help! Julia Briggs Javascript 1 12-15-2003 08:23 PM



Advertisments