I do have a file called userAuthentication.php with a function that returns a Boolean, if the authentication is successful sends "true" otherwise "false".

I also have a view called login.html, with username and password input and the corresponding submit button.

All works well, now I am wondering how could I present a message on the login.html view maybe using JS or JQuery when the function returns "false", i.e. authentication failure.

I have been going through [three PHP value pass to jQuery](https://stackoverflow.com/questions/8335267/three-php-value-pass-to-jquery) & [jquery - passing value to php](https://stackoverflow.com/questions/4555670/jquery-passing-value-to-php). 

I am looking for the best way to do it, so I could use the same method for any other implementation.

Thanks in advance,