O'Reilly logo

The Majesty of Vue.js by Kostas Maniatis, Alex Kyriakidis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

JavaScript file

As you may have noticed, our code is becoming big, and as our project grows, it will be hard to maintain. For starters, we'll separate the JavaScript code from the HTML. I'll create a file called app.js and I'll save it under js directory.

All the JavaScript code should live inside that file from now on. To include the newly created script to any HTML page you simply have to add this tag:

<script src='/js/app.js' type="text/javascript"></script> 

and you are ready to go!

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required