Showing posts with label WHAT IS JAVASCRIPT. Show all posts
Showing posts with label WHAT IS JAVASCRIPT. Show all posts

Monday, May 3, 2021

RUNNING EXTERNAL FILES IN JAVASCRIPTS


GLSW4E BOOKS FACEBOOK  W4E INSTAGRAM W4E YOUTUBEW4E HOME
FOLLOW US


In this sections, we will learn how to run a script (as an external file) from another JavaScript file. 


Before we start, let us see more examples on adding script to html:

RUNNING EXTERNAL FILES IN JAVASCRIPTS-GLS


Another example

RUNNING EXTERNAL FILES IN JAVASCRIPTS--GLS


Now lets see how we can run a script from another html/JavaScript file.


--------Create external JavaScript file with the extension .js.

--------After creating, add it to the HTML file in the script tag.

--------The src attribute is used to include that external JavaScript file.

---------If you have more than one external JavaScript file, then add it in the same web page to increase performance of the page.

•Example:

•Let’s say you created the following new.js external JavaScript file:

RUNNING EXTERNAL FILES IN JAVASCRIPTS

 Now add the external JavaScript file to the HTML web page:

RUNNING EXTERNAL FILES IN JAVASCRIPTS


So that is how to call one script from another. Next, we will look at the types of DATA YPES that are supported n JavaScript.


CONTINUE READING - SUPPORTED DATA TYPES IN JAVASCRIPTS


Watch Video

 

MORE JAVASCRIPT ARTICLES FROM GLS BELOW