var url = 'http://chenBug.com' ;
var encodeUrl = JSON.stringify(encodeURIComponent(url));
console.log(encodeUrl); //http%3A%2F%2FchenBug.com

var decodeUrl = decodeURIComponent(JSON.parse(encodeUrl));
console.log(decodeUrl); // http://chenBug.com