Trigger method without changing url

Hi, I’d like to know how can I do a button that on click with call an action, but wont reload the page.

Like the “like” button at facebook.

Thanks in advance.

Rodrigo Ruiz wrote in post #1049716:

Hi, I'd like to know how can I do a button that on click with call an
action, but wont reload the page.

If you're calling back to your same origin (domain) then you can use
XHTTPRequest (a.k.a. AJAX). We almost never use that object directly.
It's usually managed by a JavaScript framework such as jQuery.

Example: