PDA

View Full Version : Need assistance with jQuery+Prototype.js conflict.


thecore762
01-11-2012, 01:31 AM
Hey guys, I need some help.
The mod developer is somewhat busy in life and too busy to fix his paid products...(I know sad no?)

Currently the donation system uses prototype.js and I currently run jQuery on my forums page.
The donation bar will not load showing the progression.
See here: http://www.47r-squad.com/forum.php
See front page: http://www.47r-squad.com that's how it supposed to work.

These are the mods I currently use that are conflicting:
- https://vborg.vbsupport.ru/showthread.php?t=276419
- https://vborg.vbsupport.ru/showthread.php?t=250340&highlight=awcoding

Your assistance will be greatly appreciated.

LifesGreatestGift
01-11-2012, 01:50 AM
What is causing your issue is that you are running the tooltip mod. You just need to change the code for the jQuery to use noconflict

In your tooltip mod code change it to
<script>
$.noConflict();
jQuery("#scanudesc a[title]").tooltip({
position: "bottom right",
effect: "slide"
});
</script>

and see if that fixes the issue.

EDIT

whats weird is the jQuery tooltip code is embedded and called for every forum you have. Bad coding. It should have been called in the head due to it not having dynamic content.

LifesGreatestGift
01-11-2012, 01:57 AM
<a href="https://vborg.vbsupport.ru/showthread.php?t=276419&highlight=description" target="_blank">https://vborg.vbsupport.ru/showt...ht=description</a>

It actually looks like he has his JS wrapped around a couple conditionals in the plugins.

thecore762
01-11-2012, 02:01 AM
What is causing your issue is that you are running the tooltip mod. You just need to change the code for the jQuery to use noconflict

In your tooltip mod code change it to
<script>
$.noConflict();
jQuery("#scanudesc a[title]").tooltip({
position: "bottom right",
effect: "slide"
});
</script>

and see if that fixes the issue.

EDIT

whats weird is the jQuery tooltip code is embedded and called for every forum you have. Bad coding. It should have been called in the head due to it not having dynamic content.

Hmmm, should I try the following or it would be no help?

LifesGreatestGift
01-11-2012, 02:03 AM
if you edit the actual plugin in the admincp and make the changes to both instances (because he is using a if else conditional) it should work.

It appears it's in the
<title>Code replace</title>
<hookname>parse_templates</hookname>
plugin for the product.

--------------- Added 1326251138 at 1326251138 ---------------

<vb:if condition="$forum[islastshown]">
<script>
$("#scanudesc a[title]").tooltip({
position: "bottom right",
effect: "slide"
});
</script></vb:if><vb:else />
<script>
$("#scanudesc a[title]").tooltip({
position: "bottom right",
effect: "slide"
});
</script>
</vb:if>

The code could use some work.

--------------- Added 1326251193 at 1326251193 ---------------

Although its possible it won't work because the prototype code is called before the jQuery....

HMBeaty
01-11-2012, 02:21 AM
<vb:if condition="$forum[islastshown]">
<script>
$("#scanudesc a[title]").tooltip({
position: "bottom right",
effect: "slide"
});
</script></vb:if><vb:else />
<script>
$("#scanudesc a[title]").tooltip({
position: "bottom right",
effect: "slide"
});
</script>
</vb:if>The code could use some work.
lol no kidding! I'm curious if that part of it even works like it should since the way the conditional is written is wrong

LifesGreatestGift
01-11-2012, 02:26 AM
Hope all goes well ;) Glad I could help, btw for future onlookers

the code needed to be changed from
<script>
$("#scanudesc a[title]").tooltip({
position: "bottom right",
effect: "slide"
});
</script>
TO
<script>
$.noConflict();
jQuery("#scanudesc a[title]").tooltip({
position: "bottom right",
effect: "slide"
});
</script>

--------------- Added 1326252531 at 1326252531 ---------------

lol no kidding! I'm curious if that part of it even works like it should since the way the conditional is written is wrong

Apparently (at least on the forum in question) the script code was hard-coded into the
forumhome_forumbit_level2_post
template. but it is also inside the plugin but it was disabled.

thecore762
01-11-2012, 02:30 AM
Thank you for fixing it for me :)