It has a button with the text Play and a footer where we show a copyright text. The entry point HTML file creates the structure to show the image of the gift and the names of Santa and the child. Every time you click the Play button, a new Santa, child, and gift are selected. The Secret Santa Game is a simple game that selects a Santa, a Child, and the gift that Santa to give to the child. You have to make sure the page loading speed is not degraded because of this.īut hold on! How does the larger script file degrade the page loading speed? Let's understand with the demonstration of a simple app called The Secret Santa Game. If your app is a tiny one dealing with script files of a few KBs, you will only care a little about the page speed and script loading.īut you may deal with larger scripts written by a 3rd party library or by you in real life. Specifying the tag inside the or tags has its own consequences. įinally, you need to make sure you place the tag either inside the tag or at the end of the tag of the HTML file. The src attribute of the tag points to the JavaScript file you want to load. You need to use the tag to load and execute this code. js which stands for JavaScript) with all the JavaScript code. Assume we have a file called some-script.js (note the file extension. Let's first understand the basics of loading JavaScript code from an external file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |