Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
116
rated 0 times [  122] [ 6]  / answers: 1 / hits: 20501  / 13 Years ago, tue, may 31, 2011, 12:00:00

Hi I have problem with adding javascript into a joomla module..I've found some solution, but it's not working..



$document = &JFactory::getDocument();
$document->addScript(/career.js);


These two lines I have in my module, but the script isn't in rendered site..
The file is in root of my web (for test purposes only).



Thanks for your help


More From » joomla

 Answers
2

Ouch..The main problem is, that I am loading the page containing custom module with javascript is loaded via ajax..And all the plugins seems to be adding the js code into head and I only replace some elements into body of my page.
exist some solution to this problem?I know I can have all the js logic into one file, but I am not sure it is good way. Is somehow possible to include js directly to module?So that the script tag will be within my document body and correctly included (i am not sure the code will be fired??)



Thanks


[#91943] Monday, May 30, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
daryldeontaeh

Total Points: 46
Total Questions: 97
Total Answers: 105

Location: Maldives
Member since Sat, Jan 29, 2022
2 Years ago
;