Summary
In this chapter, we’ve shown how to add JavaScript to a web page. Adding JavaScript to a web page is a common task and can be done in two ways, either by adding a script
tag to the head
element or by pointing to a standalone file.
We’ve also shown how we can build on our use case from previous chapters by adding behavior to our app. We first showed how to even let JavaScript generate the markup, which can become a bit unwieldy. Then, we made the case for using a JavaScript framework like Vue.js to make it easier to manage.
You’ve also seen how you can add a JavaScript framework like Vue.js. Exactly how you add a JavaScript framework varies by framework but it’s generally recommended to add a prompt with wording including keywords like setup or initialize to ensure you not only add a script
tag but also add code that triggers a setup process and makes the selected framework ready to use.
In the next chapter, we will show how we can add...