dist/crocodoc.viewer.js
function (url) {
            var parsedURL = this.parse(url);

            if (!parsedLocation) {
                parsedLocation = this.parse(this.getCurrentURL());
            }

            // IE7 does not properly parse relative URLs, so the hostname is empty
            if (!parsedURL.hostname) {
                return false;
            }

            return parsedURL.protocol !== parsedLocation.protocol ||
                   parsedURL.hostname !== parsedLocation.hostname ||
                   parsedURL.port !== parsedLocation.port;
        }
function (url) {
            var parsedURL = this.parse(url);

            if (!parsedLocation) {
                parsedLocation = this.parse(this.getCurrentURL());
            }

            // IE7 does not properly parse relative URLs, so the hostname is empty
            if (!parsedURL.hostname) {
                return false;
            }

            return parsedURL.protocol !== parsedLocation.protocol ||
                   parsedURL.hostname !== parsedLocation.hostname ||
                   parsedURL.port !== parsedLocation.port;
        }
function ( url ) { var parsedURL = this . parse ( url ) ; if ( ! parsedLocation ) { parsedLocation = this . parse ( this . getCurrentURL ( ) ) ; } // IE7 does not properly parse relative URLs, so the hostname is empty if ( ! parsedURL . hostname ) { return false ; } return parsedURL . protocol !== parsedLocation . protocol || parsedURL . hostname !== parsedLocation . hostname || parsedURL . port !== parsedLocation . port ; }
Returns true if the given url is external to the current domain
@param   {string}  url The URL
@returns {Boolean} Whether or not the url is external
Returns true if the given url is external to the current domain