Search
Other Sourcerer questions
Forum

Using and activating PHP and JavaScript in an article by clicking on a button

Winfried Buijen's Avatar Winfried Buijen
Hi Peter,
I have the following situation.
In a page I have an article with one module inside it and two modules in the sidebar.

The modules in the sidebar are for
1. throw dices by clicking on a button
2. switch between test and practice mode by clicking on a button

The article has a module with 36 clickable pictures in it.
The visitor should click on the picture that corresponds with the dices.

I want to use sourcerer for php and javascript code to perform the calculation and handling the results.
But how do I code the mouseclick to perform the javascript actions.
And is it better to put the javascript code in a file or directly in the article/module?

Thanks for your reply!

Kind regards,
Winfried Buijen
Peter van Westen's Avatar Peter van Westen ADMIN
That is a very specific javascript question, that doesn't have much to do with Sourcerer itself.
Triggering javascript functions via an onclick on a button is standard html/javascript knowhow.
I recommend you use google to find answers on that. Or hire a webdeveloper that does know how javascript works.

Whether it is better to place javascript inline or in an external file is also more of a javascript-centic question and all depends on the amount of javascript and whether you need to re-use it in different pages.
Please post a rating at the Joomla! Extensions Directory
Winfried Buijen's Avatar Winfried Buijen
Thanks for your reply Peter.
I have already tried to find the solution, but that what comes around, like w3schools.com, don't give the answers I need.
But thanks anyway 🙂
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription