Skip to content

Instantly share code, notes, and snippets.

@artembeloglazov
Last active September 23, 2015 15:37
Show Gist options
  • Select an option

  • Save artembeloglazov/b78e09a4b45ece657c3b to your computer and use it in GitHub Desktop.

Select an option

Save artembeloglazov/b78e09a4b45ece657c3b to your computer and use it in GitHub Desktop.
Динамическая подгрузка js-скрипта с учетом обхода ограничения по mime-типу(http://stackoverflow.com/questions/24528211/refused-to-execute-script-from-because-its-mime-type-application-json-is)
$.getScript("URL", function(){});
// вариант для redmine + wiki
$.ajax({
url: 'URL',
dataType: "text"
}).done(function(script, textStatus) {
eval(script.replace(/~~~.*/g, ''));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment