[thelist] Please Help w/ Javascript Error

.jeff jeff at members.evolt.org
Fri Mar 1 11:18:46 CST 2002


gina,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Gina K. Anderson
>
> I've been beating my brains out with this for a couple
> of days and only writing because my time is running out.
> I have OpenCube's QuickDHTL Menu, and I have it working
> fine on the index page of the site, but it craps out on
> a page inside a folder. I've tried an absolute URL in
> the script source, and various other things, but I just
> can't find the problem. I've contacted OpenCube support
> twice, and no response :-( The client is supposed to see
> this today, and I'd like to get it working:
>
> See http://pearl.sitediva.com
> The menu works fine here.
>
> Click the "Hosting" main rollover image, and you'll go to:
> http://pearl.sitediva.com/hosting/index.html
>
> Nuthin'..except errors I don't understand/can't find.
> Both pages are using the same scripts, all I did with
> hosting/index.html was erase all the stuff other than
> the header in the main index and save. Dreamweaver took
> care of the link porting--it looks fine--what's wrong
> with it?
>
> JS Sources are:
> http://pearl.sitediva.com/menu_data.js
> http://pearl.sitediva.com/scripts/
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

i'd take a look at this article to give you of guaranteeing these errors
won't pop up at all:

Making Peace: Legacy Browsers and External Scripts
http://evolt.org/article/thelist/17/9054/

now, to your problem.

make sure the browser can get to the scripts.  do that by making sure the
path is always correct.  i'd probably do that by making all the links to the
scripts root relative.  ie, i'd change them from this:

<script language="JavaScript1.2" src="menu_data.js"></script>
<script language="JavaScript1.2" src="scripts/dqm_script.js"></script>

or this:

<script language="JavaScript1.2" src="../menu_data.js"></script>
<script language="JavaScript1.2" src="../scripts/dqm_script.js"></script>

to this:

<script language="JavaScript1.2" src="/menu_data.js"></script>
<script language="JavaScript1.2" src="/scripts/dqm_script.js"></script>

now it won't matter where in the site/directory structure the page is.
it'll always find the scripts.

good luck,

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/




More information about the thelist mailing list