Get The Current Root URL

    A very simple snippet, which stores the root URL in a variable:
    [javascript]
    // Retrieve root URL
    var root = location.protocol + ‘//’ + location.host;
    [/javascript]

    Leave a Reply