yes, I am just trying to write a simple activity module, which in frist step only displays a button and executes a DB query on button click. The result of the query should be displayed on the same page as the button - in a div or something.
Because the button is clicked on client side, I thought JS should be used to handle it. I created an AMD module as shown in your example but then got stuck in ajax and webservice stuff.
Generally I'm not sure when JS should be used and how ajax is tied to webservices in Moodle. I read Moodle should work when JS is disabled in client browser.
Thanks a lot for your help.