Using Javascript

Summary

Example

It happens that some specific javascript you want to use can clash with Sitecake in edit mode. Solution is to exclude that script in edit mode. There is a boolean sitecakeGlobals.editMode that you can use for edit mode detection.

Put this script in the header of your page:

<script type="text/javascript">
  $(function() {
    if ( !window.sitecakeGlobals || sitecakeGlobals.editMode !== true ) {
      $.getScript('js/yourscript.js');
    }
  });
</script>