Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5972585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:40:43+00:00 2026-05-22T20:40:43+00:00

I tried to include the JQuery lib into joomla but it’s not working. Many

  • 0

I tried to include the JQuery lib into joomla but it’s not working. Many comps and modules use mootools inside my CMS. I think the problem is a conflict between the two frameworks.

I have searched the internet and found some articles but the following code is still not working as expected.

<?php
JHTML::stylesheet('demo_page.css', 'media/system/css/');
JHTML::stylesheet('ftab.css', 'media/system/css/');
JHTML::stylesheet('demo_table.css', 'media/system/css/');
$option="com_mycomp";
$base=JUri::root().'components/'.$option.'/js/';
$document=&JFactory::getDocument();
$noConflict="jQuery.noConflict();";
//$document->addScriptDeclaration($noConflict);
$document->addScriptDeclaration("jQuery(document).ready(function($){jQuery('#example').dataTable();});");
JHTML::script('jquery.js',$base,true);
$document->addScript($base,'jquery.js');
$document->addScript($base,'jquery.dataTables.js');
?>

This should sort my table using JQuery but it does not.

How do I use mootools and jQuery concurrently in joomla ?

Thank you in advance for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T20:40:44+00:00Added an answer on May 22, 2026 at 8:40 pm

    Reading your code, I see this:

    $noConflict="jQuery.noConflict();";
    //$document->addScriptDeclaration($noConflict);
    $document->addScriptDeclaration("jQuery(document).ready(function($){jQuery('#example').dataTable();});");
    JHTML::script('jquery.js',$base,true);
    $document->addScript($base,'jquery.js');
    $document->addScript($base,'jquery.dataTables.js');
    

    but it should look like this:

    JHTML::script('jquery.js',$base,true);
    $document->addScript($base,'jquery.js');
    $document->addScript($base,'jquery.dataTables.js');
    $noConflict="jQuery.noConflict();";
    //$document->addScriptDeclaration($noConflict);
    $document->addScriptDeclaration("jQuery(document).ready(function($){jQuery('#example').dataTable();});");
    

    Now, here’s why:

    Javascript is interpreted in the order it comes to the page. The page is being told to use jQuery.noConflict() and the jQuery datatable, before it knows what those things are.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do you pass a parameter into an include file? I tried the following
I downloaded the jquery files and tried to include them in my Site.Master, and
So I'm trying to get some basic jQuery code with Rails working, but it
I have a base.mako template with a if statement to include or not jQuery
I tried to compile this example: #include <stdio.h> #include <stdlib.h> #include <stddef.h> main(){ size_t
I tried without any result. My code looks like this: #include stdafx.h #include <iostream>
File formats I would like to play include .wav, .mp3, .midi. I have tried
I just don't get it. Tried on VC++ 2008 and G++ 4.3.2 #include <map>
Tried to map it from Preferences -> Settings -> Keyboard, but the key combo
Tried following the instructions here: How to use Google app engine with my own

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.