To put it simply, there is NO SUCH THING. JavaScript cannot be secure. Keep reading and I will give you some ideas though. The only secure thing that JavaScript does is to protect the user from malicious web sites.
Read more