1 00:00:00,120 --> 00:00:05,280 JavaScript can be inserted into a separate document and called when necessary. 2 00:00:05,310 --> 00:00:08,230 This is known as an external JavaScript file. 3 00:00:08,370 --> 00:00:12,660 You might recall we did this scene with our external C Ss file. 4 00:00:12,690 --> 00:00:17,730 Let's take a javascript function in our previous lesson and inserted into a new file. 5 00:00:22,050 --> 00:00:30,020 And when a copy of the entire function or sorry when it cut it I'm going to create a new file and paste 6 00:00:30,020 --> 00:00:32,940 it. 7 00:00:33,040 --> 00:00:40,730 Now I'm going to save this file as dog age J.S. J stands for JavaScript 8 00:00:46,260 --> 00:00:50,730 now in the head take we need to call this script 9 00:00:56,680 --> 00:01:00,820 and we'll do that by adding a source attribute to the script tag 10 00:01:08,850 --> 00:01:14,060 now we'll save this file and I'll previewed in my browser just to make sure it works. 11 00:01:22,160 --> 00:01:27,010 We can see that the script is working so we know that the javascript file was called successful 12 00:01:34,340 --> 00:01:38,180 there's a couple of advantages to using external JavaScript files. 13 00:01:38,180 --> 00:01:46,280 First it makes the HCM L code in JavaScript code easier to maintain cached JavaScript files. 14 00:01:46,300 --> 00:01:49,210 Also increase the speed at which the web page loads.