Nicholas Brick
unread,Mar 29, 2012, 7:45:38 PM3/29/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to joomla-de...@googlegroups.com
I have a problem getting some simple Javascript to work in a custom component I am building
I have a simple onclick="runthisfunction()" attribute added to a form checkbox
I precede this with
$document = &JFactory::getDocument();
$document->addScript("components/com_myone/mycode.js");
and that seems to load my js file correctly into the head section
The action of runthisfunction() is simply an alert("hello World") and I've tested it in a simple html file, works everytime
However, when in the midst of my Joomla component, When I run this and click on the checkbox nothing happens
Everything looks ok when I view source or inspect with Firebug
The mycode.js has been loaded in the head section
The checkbox in the form has the onclick="runthisfunction()" in place
but nothing happens, no errors, no crash, no alert
I've checked and double checked for spelling of case issues, all is fine
This is my 1st attempt to include JS within my component, so most likely my own mistake but I cannot see it
any help gratefully received, is there something I'm overlooking ?
Thx