Skip to content

Commit e7642f7

Browse files
authored
removing h1 but making JS more fool-proof
1 parent 3a97249 commit e7642f7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

frontend/encore/simple-example.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ In Symfony, use the ``asset()`` helper:
9696
<link rel="stylesheet" href="{{ asset('build/global.css') }}">
9797
</head>
9898
<body>
99-
<h1></h1>
10099
<!-- ... -->
101100
<script src="{{ asset('build/app.js') }}"></script>
102101
</body>
@@ -135,7 +134,7 @@ Great! Use ``require()`` to import ``jquery`` and ``greet.js``:
135134
var greet = require('./greet');
136135
137136
$(document).ready(function() {
138-
$('h1').html(greet('john'));
137+
$('body').prepend('<h1>'+greet('john')+'</h1>');
139138
});
140139
141140
That's it! When you build your assets, jQuery and ``greet.js`` will automatically

0 commit comments

Comments
 (0)