examples/weather/angular.js
function isSameOrigin(requestUrl) {
        var parsed = (typeof requestUrl === 'string') ? resolve(requestUrl, true) : requestUrl;
        return (parsed.protocol === originUrl.protocol &&
                parsed.host === originUrl.host);
      }
function isSameOrigin(requestUrl) {
        var parsed = (typeof requestUrl === 'string') ? resolve(requestUrl, true) : requestUrl;
        return (parsed.protocol === originUrl.protocol &&
                parsed.host === originUrl.host);
      }
Parse a request URL and determine whether this is a same-origin request as the application document.

@param {string|object} requestUrl The url of the request as a string that will be resolved
or a parsed URL object.
@returns {boolean} Whether the request is for the same origin as the application document.