skip head and foot js when empty, backport 35230

closes universityofglasgow/issues#28
Merge pull request #12 from universityofglasgow/issue28

skip head and foot js when empty, backport 35230