I hate to ask questions like that, but i have been searching for quite a while, and i didn't find what i am looking for in either google or stackoverflow yet. I am looking for a way to show a short message on button click.
I know about alert('message'); but what i am looking for is a lot different.
When the button is clicked i want to :
- Not reload the page.
- Display a very short 1-2 line message next to the button that was clicked, depending on the result of a php function.
- Excecute php function
One example is stack-overflow's message you get when you try to upvote your own question/answer/comment.
To decide which message you get, i will have to run a php function ( which i already have made ) and depending on the return
value of that function i will either show message A
, or message B
. Any suggestions/guidance to this matter is welcome.