- Posts: 12
COMMUNITY FORUM
K2 Installed Using JQuery with RSForms
- Kris Henneman
-
Topic Author
- Offline
- New Member
Less
More
10 years 9 months ago #130762
by Kris Henneman
K2 Installed Using JQuery with RSForms was created by Kris Henneman
I have K2 and RSForms installed. I am trying to use JQuery within my RSForm, but none of my JQuery code will work when the following line is on my page.
Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 9 months ago #130763
by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: K2 Installed Using JQuery with RSForms
Make sure your other scripts are loading AFTER K2's jQuery instance.
Otherwise they will break. Also make sure that the template or another system plugin is not loading jQuery as well.
Otherwise they will break. Also make sure that the template or another system plugin is not loading jQuery as well.
Please Log in or Create an account to join the conversation.
- Kris Henneman
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 12
10 years 9 months ago #130764
by Kris Henneman
Replied by Kris Henneman on topic Re: K2 Installed Using JQuery with RSForms
From looking at the head section, I see the following in order...
/media/system/js/mootools-core.js
/media/system/js/core.js
//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js
/components/com_k2/js/k2.js?v2.6.8&sitepath=/
/components/com_rsform/assets/js/script.js?v=49
/media/system/js/mootools-more.js
/templates/shape5_vertex/js/multibox/overlay.js
/templates/shape5_vertex/js/multibox/multibox.js
/templates/shape5_vertex/js/s5_font_adjuster.js
/templates/shape5_vertex/js/s5_info_slide.js
The JQuery script that I am trying to run is located after mootools-more.js, so it is definitely after the jquery load.
/media/system/js/mootools-core.js
/media/system/js/core.js
//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js
/components/com_k2/js/k2.js?v2.6.8&sitepath=/
/components/com_rsform/assets/js/script.js?v=49
/media/system/js/mootools-more.js
/templates/shape5_vertex/js/multibox/overlay.js
/templates/shape5_vertex/js/multibox/multibox.js
/templates/shape5_vertex/js/s5_font_adjuster.js
/templates/shape5_vertex/js/s5_info_slide.js
The JQuery script that I am trying to run is located after mootools-more.js, so it is definitely after the jquery load.
Please Log in or Create an account to join the conversation.
- Kris Henneman
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 12
10 years 9 months ago #130765
by Kris Henneman
Replied by Kris Henneman on topic Re: K2 Installed Using JQuery with RSForms
Oh, and I see in the Google Chrome console, the following error.
Uncaught TypeError: Object #<HTMLDocument> has no method 'ready'.
It is trying to run the following script.
Uncaught TypeError: Object #<HTMLDocument> has no method 'ready'.
It is trying to run the following script.
Log in or Create an account to join the conversation.
- Kris Henneman
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 12
10 years 9 months ago #130766
by Kris Henneman
Replied by Kris Henneman on topic Re: K2 Installed Using JQuery with RSForms
OK, so I'm really new to JQuery, but I just figured out the problem after looking at the K2.js file.
I added:
I added:
Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 9 months ago #130767
by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: K2 Installed Using JQuery with RSForms
It was a conflict between Mootools and jQuery.
You should avoid using plain $ signs. You can try using anonymous functions as well
You should avoid using plain $ signs. You can try using anonymous functions as well
(function($){
// code with plain $ signs goes here.
})(jQuery);
Please Log in or Create an account to join the conversation.