Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save DanielWeitenauer/7f5b9189dc4fa8a17ac54ffbbd854331 to your computer and use it in GitHub Desktop.

Select an option

Save DanielWeitenauer/7f5b9189dc4fa8a17ac54ffbbd854331 to your computer and use it in GitHub Desktop.
IM HEAD
############
<script>
var elricco = {};
elricco.funcs = [];
</script>
MODULAUSGABE
############
<?php if (!rex::isBackend()): ?>
<script>
elricco.funcs.push(function () {
// hier dein Code, jQuery/$ ist verfügbar
});
</script>
<?php endif; ?>
NACH JQUERY
############
<script>
'use strict';
jQuery(function ($) {
$.each(elricco.funcs, function (idx, func) {
func();
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment