urlencode jQuery

var encoded = encodeURIComponent(str);
Michu44