For password hashing usually bcrypt is used because the time required to compute the hash can be adjusted and bcrypt automatically adds a random salt. Nevertheless, first I'm not aware of a JavaScript implementation of bcrypt, second, even those hashes can be attacked by statistical guessing attacks (try the most common passwords first).
I thought of asymmetric encryption here first. For each login/registration the server creates a unique public/private key pair and sends the public key to the client. The client encrypts the password with this key. Only the server which owns the private key can decrypt the password. But still authentication is missing. An attacker could eavesdrop the communication.
Without authentication, which is provided by HTTPs, it is not possible to secure the registration and login step.