An alternative is to have a js file that contains your configuration the way web.config does for the .net website:
configuration.js:
var configuration = {
apiurl: 'http://myserver/api/',
someOtherSetting: 'my-value'
};
, javascript, script, . .
, js:
var request = $.ajax({
url: configuration.apiurl,
type: 'GET',
cache: false,
dataType: 'json'
});
- .