WebPortal/gbol_portal/static/js/ckeditor/filemanager/scripts/filemanager.js
// Test if a given url exists
Test if a given url exists
Test if a given url exists
function file_exists (url) {
    var req = this.window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
    if (!req) {
        throw new Error('XMLHttpRequest not supported');
    }
    req.open('HEAD', url, false);
    req.send(null);
    if (req.status == 200) {
        return true;
    }
    return false;
}
function file_exists ( url ) { var req = this . window . ActiveXObject ? new ActiveXObject ( "Microsoft.XMLHTTP" ) : new XMLHttpRequest ( ) ; if ( ! req ) { throw new Error ( 'XMLHttpRequest not supported' ) ; } req . open ( 'HEAD' , url , false ) ; req . send ( null ) ; if ( req . status == 200 ) { return true ; } return false ; }
Test if a given url exists
Test if a given url exists
// http://kevin.vanzonneveld.net // +   original by: Enrique Gonzalez // +      input by: Jani Hartikainen // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // %        note 1: This function uses XmlHttpRequest and cannot retrieve resource from different domain. // %        note 1: Synchronous so may lock up browser, mainly here for study purposes. // *     example 1: file_exists('http://kevin.vanzonneveld.net/pj_test_supportfile_1.htm'); // *     returns 1: '123' // HEAD Results are usually shorter (faster) than GET