diff --git a/js/ebi-global-includes/script/4_ebiFrameworkContent.js b/js/ebi-global-includes/script/4_ebiFrameworkContent.js index d5a29fe2cb316c0b9b22c364e4862022e0350b09..efaac88afb1aa35c4a188ec2a24eeb7646ec2c1f 100644 --- a/js/ebi-global-includes/script/4_ebiFrameworkContent.js +++ b/js/ebi-global-includes/script/4_ebiFrameworkContent.js @@ -1,3 +1,14 @@ +/** + * Utility method to get if it is IE, and what integer version. + * via: https://stackoverflow.com/a/15983064 + * @returns {int} the IE version number + * @example if (isIE () && isIE () < 9) { } + */ +function isIE () { + var myNav = navigator.userAgent.toLowerCase(); + return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false; +} + /** * Utility function to toggle classes. Chiefly to show the #embl-bar. */ diff --git a/js/ebi-global-includes/script/6_ebiFrameworkInvokeScripts.js b/js/ebi-global-includes/script/6_ebiFrameworkInvokeScripts.js index 890dc3c0074dbf1449c6be88e18934a49e74b3a0..4a69c0ab67769c6ca4432fff4a5a7ce82c760c4e 100644 --- a/js/ebi-global-includes/script/6_ebiFrameworkInvokeScripts.js +++ b/js/ebi-global-includes/script/6_ebiFrameworkInvokeScripts.js @@ -21,6 +21,8 @@ function ebiFrameworkInvokeScripts() { document.addEventListener("DOMContentLoaded", function(event) { var bodyData = document.body.dataset; + // document.body.dataset not supported in < ie10 + if (isIE () && isIE () < 10) { bodyData = []; } if (bodyData["ebiframeworkinvokescripts"] != "false") { ebiFrameworkInvokeScripts(); }