Thanks Richard.
Used and mostly understood your example on how to handle a button click. But how to do something else than alert()?
e.g. execute on button click a db query in a php file and display the result of the query next to the button on the same page? I guess AJAX is needed!?
I worked with ajax a few years ago, but I dont't get the way Moodle uses it. I should use ajax.call from core/ajax which directly calls an existing webservice - do I really have to write a new webservice for this simple job?
Moodle documentation says 'webservices enable external systems to login to moodle and to execeute actions' - what external systems? Generally, why do I have to enable access for external systems when I want to use AJAX?
Thanks.
Peter