lib/requester/browser/request.js
function is_crossDomain(url) {
    var rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/

    // jQuery #8138, IE may throw an exception when accessing
    // a field from window.location if document.domain has been set
    var ajaxLocation
    try { ajaxLocation = location.href }
    catch (e) {
        // Use the href attribute of an A element since IE will modify it given document.location
        ajaxLocation = document.createElement( "a" );
        ajaxLocation.href = "";
        ajaxLocation = ajaxLocation.href;
    }

    var ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || []
        , parts = rurl.exec(url.toLowerCase() )

    var result = !!(
        parts &&
        (  parts[1] != ajaxLocParts[1]
            || parts[2] != ajaxLocParts[2]
            || (parts[3] || (parts[1] === "http:" ? 80 : 443)) != (ajaxLocParts[3] || (ajaxLocParts[1] === "http:" ? 80 : 443))
        )
    )

    //console.debug('is_crossDomain('+url+') -> ' + result)
    return result
}
function is_crossDomain(url) {
    var rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/

    // jQuery #8138, IE may throw an exception when accessing
    // a field from window.location if document.domain has been set
    var ajaxLocation
    try { ajaxLocation = location.href }
    catch (e) {
        // Use the href attribute of an A element since IE will modify it given document.location
        ajaxLocation = document.createElement( "a" );
        ajaxLocation.href = "";
        ajaxLocation = ajaxLocation.href;
    }

    var ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || []
        , parts = rurl.exec(url.toLowerCase() )

    var result = !!(
        parts &&
        (  parts[1] != ajaxLocParts[1]
            || parts[2] != ajaxLocParts[2]
            || (parts[3] || (parts[1] === "http:" ? 80 : 443)) != (ajaxLocParts[3] || (ajaxLocParts[1] === "http:" ? 80 : 443))
        )
    )

    //console.debug('is_crossDomain('+url+') -> ' + result)
    return result
}
function is_crossDomain ( url ) { var rurl = / ^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)? / // jQuery #8138, IE may throw an exception when accessing // a field from window.location if document.domain has been set var ajaxLocation try { ajaxLocation = location . href } catch ( e ) { // Use the href attribute of an A element since IE will modify it given document.location ajaxLocation = document . createElement ( "a" ) ; ajaxLocation . href = "" ; ajaxLocation = ajaxLocation . href ; } var ajaxLocParts = rurl . exec ( ajaxLocation . toLowerCase ( ) ) || [ ] , parts = rurl . exec ( url . toLowerCase ( ) ) var result = ! ! ( parts && ( parts [ 1 ] != ajaxLocParts [ 1 ] || parts [ 2 ] != ajaxLocParts [ 2 ] || ( parts [ 3 ] || ( parts [ 1 ] === "http:" ? 80 : 443 ) ) != ( ajaxLocParts [ 3 ] || ( ajaxLocParts [ 1 ] === "http:" ? 80 : 443 ) ) ) ) //console.debug('is_crossDomain('+url+') -> ' + result) return result }
Return whether a URL is a cross-domain request.
Return whether a URL is a cross - domain request .