JAVASCRIPT 40
JS baseURL By micha on 6th February 2025 03:46:34 PM
  1. let getUrl = window.location;
  2. const baseURL = getUrl.protocol + "//" + getUrl.host + getUrl.pathname.substring(0, getUrl.pathname.lastIndexOf("/")) + "/";

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.