Handling Function response in a web page

Considering it’s not the first time this question has come up on the forums, have a look: