diff --git a/js/foundationExtendEBI.js b/js/foundationExtendEBI.js index b5f1039bbbfe6c3b5a5d56b5a67ec3d84d5e61d7..24bb2864b8dc77bab3f0b3c49831af41b764b219 100644 --- a/js/foundationExtendEBI.js +++ b/js/foundationExtendEBI.js @@ -428,6 +428,11 @@ function invokeResponsiveMenuEBI() { }); $.fn.foundationExtendEBI = function() { + // Warn if inoking this on a near-empty html page + if (document.querySelectorAll('body *').length < 5) { + console.warn('It looks like you\'ve called foundationExtendEBI() before your body element has been populated with content. Most likely this is as you are using a JS framework, so you might want to read the guidance at https://wwwdev.ebi.ac.uk/style-lab/websites/meta-patterns/js-frameworks.html'); + } + // Activate EMBL dropdown menu activateEMBLdropdown();