code: function stripExtension(url) {
    var lastDotPos = url.lastIndexOf('.');
    return (lastDotPos <= 0)? url:
      url.substring (0, lastDotPos - 1);
  }
docs: Strips the file extension and everything after from a url