1

I'm a newbie to joomla. I'm trying to create a joomla module which uses some jquery actions and some image files.

Can anyone suggest me a best method to place the jquery-core and jquery plugin files inside the module. I also wants to add some image files with my module.

Sastrija
  • 3,284
  • 6
  • 47
  • 64

3 Answers3

1

To include the JQuery you should use $document->addscript()

http://docs.joomla.org/Adding_JavaScript

You should be aware that it might conflict with Mootools already loaded so you might need to use the noconflict flag for jquery to get it to work.

Jeepstone
  • 2,591
  • 5
  • 22
  • 38
0

I might be not the best person for Joomla, but can't you just get your script in mod_[modulename].php file? Or I might now have understood your question.

jtanmay
  • 2,607
  • 6
  • 26
  • 36
0

It is better if you use the manual script tag (<script></script>) to include your jQuery to avoid it conflicting with any other included scripts.

$doc->addScript will add the script to the head tag while manual inclusion will just place just above your module, which is much safer.

Matt
  • 74,352
  • 26
  • 153
  • 180
Musa
  • 1
  • 1