Skip to content

Instantly share code, notes, and snippets.

@yianni-ververis
Last active February 4, 2016 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yianni-ververis/3f01a8c7989756279025 to your computer and use it in GitHub Desktop.
Save yianni-ververis/3f01a8c7989756279025 to your computer and use it in GitHub Desktop.
Qlik Extension - external file request
// Inject the custom CSS
var vhost = '/extensions',
whitelist = [
'localhost:4848',
'yourserver'
];
if ($.inArray(window.location.host, whitelist) == -1) {
vhost = 'https://yourserver/extensions';
}
var css1 = vhost + '/senseui-dropdown/bootstrap.css';
ajax(css1);
function ajax (uri) {
$.ajax({
url: uri,
async: true,
crossDomain : true,
success: function (file) {
$("<style>").html(file).appendTo("head");
},
error: function (e) {
console.log(e);
console.log(uri);
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment