taking off the http or https off a javascript string April 12, 2024 by Tarik Try with this: var url = "https://site.com"; var urlNoProtocol = url.replace(/^https?\:\/\//i, "");