Skip to content

Instantly share code, notes, and snippets.

@elricco
Created February 20, 2017 09:51
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save elricco/a2bddb994a7a21152c65743829a2ebce to your computer and use it in GitHub Desktop.
Save elricco/a2bddb994a7a21152c65743829a2ebce 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