code: function(urlPart) {
  	urlPart = encodeURIComponent(urlPart);
  	urlPart = urlPart.replace("'","%27");
  	// Keep some chars which are url safe
  	urlPart = urlPart.replace("%2F","/");
  	return urlPart;
  }
docs: encoding.js /* file: encoding.js Convenient String encoding functions for common cases.
  These should ALWAYS be used when making html from json data.
  
  There is also CSS.escape() in the file css.escape.js for css selectors,
  which we get from https://developer.mozilla.org/en-US/docs/Web/API/CSS.escape
  and may become a standard.
  
  @author Daniel
   Url-encoding: e.g. encode a parameter value so you can append it onto a url.
  
  Why? When there are 2 built in functions:
  escape(), and encodeURIComponent() has better unicode handling -- however it doesn't
  escape 's which makes it dangerous, and it does unhelpfully encode /s and other legitimate url characters.
  This is a convenient best-of-both.