What is the best way to handle authentication using just html/js? Is sending login and password via text to webservice safe? What are other alternatives?

Also, how to indicate that user is logged in in later web service methods invocation?