It's not <i>completely</i> useless:  it's slightly helpful against an attacker that can snoop but not modify.<p>Of course, it's pretty silly to go to the trouble of writing javascript code that can not only be modified, but may have bugs, when you can just use HTTPS.