That would destroy security, since a compromised server could now get your password by serving malicious JavaScript...
On the other hand, there's nothing that's made _worse_ by choosing to do it that way. Plenty of things that are the same, some things better, but nothing worse.