Javascript String to_url()

Description

Javascript String to_url()


String.prototype.to_url = function () {
  if (this.startsWith('http://') || this.startsWith('https://')) {
    return this;//from  w  w w  .  j a v a  2s  .  c o  m
  } else {
    return root_url.slice(0, root_url.length - 1) + this;
  }
};



PreviousNext

Related