Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Javascript Output Appears After Footer


Go to End


1342 Views

Avatar
ssguest

Community Member, 7 Posts

21 August 2015 at 8:54pm

Edited: 21/08/2015 8:55pm

Why does my javascript appears after the footer? Below is my code in the layout (Page.ss):

<% include SideBar %>
<div class="content-container unit size3of4 lastUnit">
<article>
<h1>$Title</h1>
<div class="content">

<script type="text/javascript">
window.onload = function() {

var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create });

function preload () {

game.load.image('logo', 'phaser.png');

}

function create () {

var logo = game.add.sprite(game.world.centerX, game.world.centerY, 'logo');
logo.anchor.setTo(0.5, 0.5);

}

};
</script>
</div>
</article>
$Form
$CommentsForm
</div>