Create the Main JavaScript Module and Insert Other Modules Tutorial

Create the Main JavaScript Module and Insert Other Modules Tutorial

Listening Video
Learn to take a modular approach to your reusable external JavaScript library of scripts. In this lesson we create the main JavaScript module which is the file that will be called into every page of the web site.
Lesson Code
// Make this function external like I did in the video

function _(x){
return document.getElementById(x);
}
// And all over the site from now on you can get html elements by their id by simply using:

_("div1").innerHTML = "Hello World";

0 Response to "Create the Main JavaScript Module and Insert Other Modules Tutorial"

Post a Comment