473,386 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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
Aug 19 '08 #1
5 1419
we*******@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.
Aug 19 '08 #2
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)
Aug 19 '08 #3
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...
Aug 19 '08 #4
Sorry Evertjan, just repeated what you said. :-(
Aug 19 '08 #5
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 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: frasfan | last post by:
Hi, I am having a problem with the validator controls in VB.net conflicting with the javascript I am using to confirm whether or not the user wants to submit the page. Here is the situation: I...
1
by: Julia Briggs | last post by:
Hello, I have these two scripts, where the first one is being canceled out by the second, they work independently, but not together (they are a auto-tab and form box character counter script) --...
10
by: Minti | last post by:
I tried the following code on Borland C++ complier and Microsoft VC7.0 both seem to give conflicting results void foo(const int& x) { std::cout << "In const foo\n"; } void foo(int& x) ...
2
by: humble04 | last post by:
Hi, I am compiling a collection of C++ code. Most of them are using the new format #include <iostream>. I think all of them because I failed at finding out which header file uses the old format ...
7
by: Thiru | last post by:
I am writing an application that interacts with Oracle and Teradata. In order to create the executable, I need to link various Oracle and Teradata libraries. I found out that when I link the...
2
by: Head In A Pan | last post by:
Hello! My JavaScripting is at novice level - and after completing a tutorial on a 'floating layer' I was proud that I got it working on Firefox, Safari, Camino & even IE5 for mac!!! But not IE7!...
1
by: helraizer1 | last post by:
Hi folks, I have an image based shoutbox which I am currently implementing emoticons onto. I have a way now for the emoticons to appear where the :D or =) etc. is on the image, but for some reason...
12
by: Michael.Z | last post by:
Anyone who can help: Given a Table.h file I am writing a Table.c file. I keep getting the compile error: previous declaration of Table was here / conflicting types for I think the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.