Is there JSON encode/decode base64 encode/decode function in JavaScript?
Yes, btoa() and atob() work in some browsers:
var enc = btoa("this is some text"); alert(enc); alert(atob(enc));