为什么我的JavaScript出现在页脚之后?下面是我在布局中的代码(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>
Run Code Online (Sandbox Code Playgroud) 如何自定义<title>SilverStripe页面?
现在是的
<title><% if $MetaTitle %>$MetaTitle<% else %>$Title<% end_if %> » $SiteConfig.Title</title>
Run Code Online (Sandbox Code Playgroud)