PDA

View Full Version : Lightbox v2.0 - Script conflict!



MuMu
11-20-2006, 11:30 AM
1) Script Title: Lightbox Image Viewer 2.0

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/lightbox2/index.htm

3) Describe problem:

a) this is the HTML, the one that works: www.opreadiana.ro/jspr-foto.html
b) this is the HTML, the one that DOESN'T work: www.opreadiana.ro/not-working.html

The only difference between the 2, is this:

<!--/Start Trafic.ro/-->
<script type="text/javascript">t_rid="opreadiana";</script>
<script type="text/javascript"
src="http://storage.trafic.ro/js/trafic.js">
</script><noscript>
<a href="http://www.trafic.ro/top/?rid=opreadiana"
target="_blank"><img border="0" alt="trafic ranking"
src="http://log.trafic.ro/cgi-bin/pl.dll?rid=opreadiana"/></a></noscript>

<!--/End Trafic.ro/-->

When this tracker script is inserted, the script DOESN'T work anymore!
Can I get around this somehow!?

Thanks.

jscheuer1
11-21-2006, 09:14 PM
The tracking script (trafic.js) uses variable names that are the same as some of those used in Lightbox's companion script (prototype.js). However, it defines them differently. This is a source (perhaps the only source) of the conflict. It doesn't appear that you can change the tracking script. These are the variable names involved that I could easily find:

$A
$F
$H
$R

If you were to do a global, case sensitive search and replace on prototype.js, changing each of these names in it to something a bit more unique, it would take care of these variables. There could be others. There could also be other problems between these two scripts.

There are other tracking scripts. If using one of those takes care of the problem, that would be a better solution.

MuMu
11-21-2006, 10:10 PM
Thank you for your answer :)
I'll try that (when I have the time) or, I'll get around it... somehow!

Thx! :D

jscheuer1
11-22-2006, 01:25 AM
I tried this out and it appears that there were other variables or the same variables in other of lightbox's support scripts. I changed prototype.js, scriptaculous.js and effects.js and it then worked, I am attaching a .zip of these changed files:

659

MuMu
11-22-2006, 09:34 AM
You are like... a GOD to me! ;)

Many Thx!