Actually, You want to Encrypt the content in javaScript,
Then you have to write the code to encrypt the content
E[plainText]=cipherText;
D[cipherText]=plainText;
or instead of encrypting you can use Encoding standards. but any one can decode it easily(Base64) Encoding standerds..
Encryption Techniques are
1)Strong encrypting techniques: RC4, AES, Serpent, Twofish and RSA
[
You can Go through this link]
Otherwise you can use the following methods
function Encode()
{
var EncodedUrl = encodeURIComponent("YourUrl");
}