Forum Moderators: open

Message Too Old, No Replies

Javascript clash

         

Brightonfemme

4:07 pm on Jun 20, 2008 (gmt 0)

10+ Year Member



Hi,
I need help! This is the first webmaster forum I have joined!

I'm currently re-designing my site.. I have loaded 2 scripts that seems to be clashing in IE (not tested any other yet!). 1 opens up images the other is a moving logo top left.

You can see the page here with both scripts, the image opens in a new window rather then being an overlay on current page.

Script with both:

<link rel="stylesheet" href="backbox.css" type="text/css" />
<script type="text/javascript" src="js/prototype.compressed.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<script type="text/javascript" src="js/dhtmlHistory.js"></script>
<script type="text/javascript" src="js/customsignsheader.js"></script>

</head>

<body link="#CDA742" vlink="#CDA742" alink="#CDA742" bgcolor="#A7060E" text="#CDA742">

<div id="watermarklogo" style="position:absolute;"></div>

<script src="staticlogo.js">

</script>

This page is just the gallery script
<link rel="stylesheet" href="backbox.css" type="text/css" />
<script type="text/javascript" src="js/prototype.compressed.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<script type="text/javascript" src="js/dhtmlHistory.js"></script>
<script type="text/javascript" src="js/customsignsheader.js"></script>

And this with just the logo
<div id="watermarklogo" style="position:absolute;"></div>

<script src="staticlogo.js">

</script>

Any advice please! I can't write script or anything, as you see it's all copy and pasted stuff.

Sara

[edited by: Brightonfemme at 4:09 pm (utc) on June 20, 2008]

httpwebwitch

11:49 pm on Jun 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Brightonfemme! welcome to WebmasterWorld!

I feel your pain but I'm not sure how to help you...

Yes it's possible to achieve some neat things by pasting boilerplate code, but that's sort of like expecting to be able to cope in another country by memorizing some phrases phonetically. When you need to find a bathroom, "Donde est el banyo" works great. So does "dos cervesa por favor". But when a local (the script, in my metaphor) says something outside your collection of memorized phrases, you'll be unable to respond. Clashing scripts and bugs in cut-and-pasted code is like that.

I'm familiar with prototype, scriptaculous and lightbox, and I know that many people use all three together with no problems. but the other two you're using are unfamiliar to me. I'd suggest you remove customsignsheader.js, see if the problem with lightbox goes away, and if it does, find some other method to achieve what you're trying to do with that logo.

A common debugging method is to comment out sections of code until you find the part that's causing the error. But another (which I recommend to you in this instance) is to put an ad in your local paper for a Javascript developer who will work freelance, who can help you out with this and future challenges. Along the way you may learn a little Javascript yourself, and save the expense!

Good luck

kceleb9

4:54 pm on Jun 23, 2008 (gmt 0)

10+ Year Member



Honestly - prototype is not a great library for "playing friendly" with other libraries - because of it's mapping of $ - a better choice is perhaps jquery - which gives you option of $.noConflict() - to prevent clashes between jquery and other libraries...

otherwise i would say look for plug ins specific to your core library of choice...