Last active
February 4, 2016 16:11
-
-
Save yianni-ververis/3f01a8c7989756279025 to your computer and use it in GitHub Desktop.
Qlik Extension - external file request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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