function loadParametersJSON(sUrl, sThemeBaseUrl, aWithCredentials) {
			var bCurrentWithCredentials = aWithCredentials.shift();

			var mHeaders = bCurrentWithCredentials ? {
				// the X-Requested-With Header is essential for the Theming-Service to determine if a GET request will be handled
				// This forces a preflight request which should give us valid Allow headers:
				//   Access-Control-Allow-Origin: ... fully qualified requestor origin ...
				//   Access-Control-Allow-Credentials: true
				"X-Requested-With": "XMLHttpRequest"
			} : {};

			// load and evaluate parameter file
			jQuery.ajax({
				url: sUrl,
				dataType: 'json',
				async: false,
				xhrFields: {
					// default is false
					withCredentials: bCurrentWithCredentials
				},
				headers: mHeaders,
				success: function(data, textStatus, xhr) {
					// Once we have a successful request we track the credentials setting for this origin
					var sThemeOrigin = new URI(sThemeBaseUrl).origin();
					mOriginsNeedingCredentials[sThemeOrigin] = bCurrentWithCredentials;

					if (Array.isArray(data)) {
						// in the sap-ui-merged use case, multiple JSON files are merged into and transfered as a single JSON array
						for (var j = 0; j < data.length; j++) {
							var oParams = data[j];
							mergeParameters(oParams, sThemeBaseUrl);
						}
					} else {
						mergeParameters(data, sThemeBaseUrl);
					}
				},
				error: function(xhr, textStatus, error) {
					// ignore failure at least temporarily as long as there are libraries built using outdated tools which produce no json file
					Log.error("Could not load theme parameters from: " + sUrl, error); // could be an error as well, but let's avoid more CSN messages...

					if (aWithCredentials.length > 0) {
						// In a CORS scenario, IF we have sent credentials on the first try AND the request failed,
						// we expect that a service could have answered with the following Allow header:
						//     Access-Control-Allow-Origin: *
						// In this case we must not send credentials, otherwise the service would have answered with:
						//     Access-Control-Allow-Origin: https://...
						//     Access-Control-Allow-Credentials: true
						// Due to security constraints, the browser does not hand out any more information in a CORS scenario,
						// so now we try again without credentials.
						Log.warning("Initial library-parameters.json request failed ('withCredentials=" + bCurrentWithCredentials + "'; sUrl: '" + sUrl + "').\n" +
									"Retrying with 'withCredentials=" + !bCurrentWithCredentials + "'.", "sap.ui.core.theming.Parameters");
						loadParametersJSON(sUrl, sThemeBaseUrl, aWithCredentials);
					}
				}
			});
		}
/**
		 * Loads a parameters.json file from given URL.
		 * @param {string} sUrl URL
		 * @param {string} sThemeBaseUrl Base URL
		 * @param {boolean[]} aWithCredentials probing values for requesting with or without credentials
		 */
Loads a parameters.json file from given URL.
@param {string} sUrl URL
@param {string} sThemeBaseUrl Base URL
@param {boolean[]} aWithCredentials probing values for requesting with or without credentials
Loads a parameters . json file from given URL . @param { string } sUrl URL @param { string } sThemeBaseUrl Base URL @param { boolean [] } aWithCredentials probing values for requesting with or without credentials
function loadParametersJSON(sUrl, sThemeBaseUrl, aWithCredentials) {
			var bCurrentWithCredentials = aWithCredentials.shift();
			var mHeaders = bCurrentWithCredentials ? {
				"X-Requested-With": "XMLHttpRequest"
			} : {};
			jQuery.ajax({
				url: sUrl,
				dataType: 'json',
				async: false,
				xhrFields: {
					withCredentials: bCurrentWithCredentials
				},
				headers: mHeaders,
				success: function(data, textStatus, xhr) {
					var sThemeOrigin = new URI(sThemeBaseUrl).origin();
					mOriginsNeedingCredentials[sThemeOrigin] = bCurrentWithCredentials;
					if (Array.isArray(data)) {
						for (var j = 0; j < data.length; j++) {
							var oParams = data[j];
							mergeParameters(oParams, sThemeBaseUrl);
						}
					} else {
						mergeParameters(data, sThemeBaseUrl);
					}
				},
				error: function(xhr, textStatus, error) {
					Log.error("Could not load theme parameters from: " + sUrl, error); 
					if (aWithCredentials.length > 0) {
						Log.warning("Initial library-parameters.json request failed ('withCredentials=" + bCurrentWithCredentials + "'; sUrl: '" + sUrl + "').\n" +
									"Retrying with 'withCredentials=" + !bCurrentWithCredentials + "'.", "sap.ui.core.theming.Parameters");
						loadParametersJSON(sUrl, sThemeBaseUrl, aWithCredentials);
					}
				}
			});
		}
function loadParametersJSON ( sUrl , sThemeBaseUrl , aWithCredentials ) { var bCurrentWithCredentials = aWithCredentials . shift ( ) ; var mHeaders = bCurrentWithCredentials ? { "X-Requested-With" : "XMLHttpRequest" } : { } ; jQuery . ajax ( { url : sUrl , dataType : 'json' , async : false , xhrFields : { withCredentials : bCurrentWithCredentials } , headers : mHeaders , success : function ( data , textStatus , xhr ) { var sThemeOrigin = new URI ( sThemeBaseUrl ) . origin ( ) ; mOriginsNeedingCredentials [ sThemeOrigin ] = bCurrentWithCredentials ; if ( Array . isArray ( data ) ) { for ( var j = 0 ; j < data . length ; j ++ ) { var oParams = data [ j ] ; mergeParameters ( oParams , sThemeBaseUrl ) ; } } else { mergeParameters ( data , sThemeBaseUrl ) ; } } , error : function ( xhr , textStatus , error ) { Log . error ( "Could not load theme parameters from: " + sUrl , error ) ; if ( aWithCredentials . length > 0 ) { Log . warning ( "Initial library-parameters.json request failed ('withCredentials=" + bCurrentWithCredentials + "'; sUrl: '" + sUrl + "').\n" + "Retrying with 'withCredentials=" + ! bCurrentWithCredentials + "'." , "sap.ui.core.theming.Parameters" ) ; loadParametersJSON ( sUrl , sThemeBaseUrl , aWithCredentials ) ; } } } ) ; }
Loads a parameters.json file from given URL.
Loads a parameters . json file from given URL .
// the X-Requested-With Header is essential for the Theming-Service to determine if a GET request will be handled // This forces a preflight request which should give us valid Allow headers: //   Access-Control-Allow-Origin: ... fully qualified requestor origin ... //   Access-Control-Allow-Credentials: true // load and evaluate parameter file // default is false // Once we have a successful request we track the credentials setting for this origin // in the sap-ui-merged use case, multiple JSON files are merged into and transfered as a single JSON array // ignore failure at least temporarily as long as there are libraries built using outdated tools which produce no json file // could be an error as well, but let's avoid more CSN messages... // In a CORS scenario, IF we have sent credentials on the first try AND the request failed, // we expect that a service could have answered with the following Allow header: //     Access-Control-Allow-Origin: * // In this case we must not send credentials, otherwise the service would have answered with: //     Access-Control-Allow-Origin: https://... //     Access-Control-Allow-Credentials: true // Due to security constraints, the browser does not hand out any more information in a CORS scenario, // so now we try again without credentials.