Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Forum Module

Discuss the Forum Module.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Javascript problem


Go to End
Reply

12 Posts   2268 Views

Avatar
animasola

19 June 2009 at 4:24am Community Member, 121 Posts

Hi,

I'm currently finishing a site for a school organization which I am a part of and I just have some minor problems that I wanna fix. I used mootools (js framework) to animate my main navigation but it seems that it doesn't work once I view the forum and event calendar pages. I tried to trace the problem and I found out that those pages have javascript includes which may conflict with the ones I have written.

Here is the site btw: http://lexlounge.com/

Can anyone help me with this problem?

Avatar
Nivanka

19 June 2009 at 6:27am Community Member, 395 Posts

sometimes for some pages SS use jQuery and Prototype, both has the $ function, but for jQuery there is a way to avoid the conflicts by calling the jQuery.noConflicts() function.

I am not sure whether mootools has that too. Check it with that, also I tried to help one of my friends with this, but I couldnt find a way to solve it. if anyone can it will be a great help.

Avatar
animasola

19 June 2009 at 1:08pm Community Member, 121 Posts

Thanks! Just what I needed, I didn't know that these pages used JQuery and Prototype and I'm not familiar with the $ function as well. I'll try to solve it myself in the meantime. But to anyone who is an expert or who is familiar with this problem, please do help. Thanks a lot!

Thanks Nivanka! :)

Avatar
Nivanka

19 June 2009 at 2:41pm Community Member, 395 Posts

welcome,

I am too eager to find out a way to use mootools with other javascript libraries. I think better if you can post on their forums.

Avatar
animasola

19 June 2009 at 2:51pm (Last edited: 19 June 2009 2:56pm), Community Member, 121 Posts

I just followed your advice and used jQuery.noConflict(); as an inline script right after the call to the core main jquery library.

I inserted it within the CalendarUI.class.php on line 23, within the customScript. And with others that also required jquery, I just placed this line of code after each call:

Requirements::customScript("
   jQuery.noConflict();
");

I'm not sure if this is safe but it works nonetheless. Thanks again Niv!

Cheers,
Vic

Avatar
Nivanka

19 June 2009 at 2:53pm Community Member, 395 Posts

it must be safe, so all working fine now?

Avatar
animasola

19 June 2009 at 2:56pm Community Member, 121 Posts

Yep! Thanks a lot! :)

Avatar
draft

7 July 2009 at 4:28pm Community Member, 57 Posts

Hi,

I'm having the same problem with mootools.. In my main page, i have an animation using mootools, but when i create a form there (which will create javascript validation), the animation stop working, and it gave me this javascript error : $$.shared is not defined.

Anyone can help me? Please tell me where to put the jquery.noconflicts function?

-Draft

Go to Top