HTML5 enable you to store data locally which I think it is great. For example here is how you can use it:
var store = window.localStorage; st
Try the btoa function:
var data = btoa(r);