How To Insert Menu Scripts

Table of contents:

How To Insert Menu Scripts
How To Insert Menu Scripts

Video: How To Insert Menu Scripts

Video: How To Insert Menu Scripts
Video: Creating Command Line Menus with Shell Scripts 2024, May
Anonim

Scripts are programs written in a programming language for use on an Internet resource. To insert a script, you need to integrate its code into a suitable place on the page within the appropriate HTML descriptor.

How to insert menu scripts
How to insert menu scripts

Instructions

Step 1

On the Internet resources JavaScript is usually used to activate scripts. This programming language allows you to integrate active content, on the basis of which the menu bar is built, containing drop-down lists.

Step 2

Open the HTML page in any text editor. To do this, you can use the standard Windows utility "Notepad", which is available when you right-click on a file and select "Open With" in the context menu. For more convenient editing, you can use the small program Notepad ++, which has a function for highlighting HTML and JavaScript code, which will make it easier for you to navigate the code.

Step 3

You will see HTML in the text of the page. To insert a JavaScript script, you need to go to the section and enter the required code. For example:

Menu script content

In this example, you can directly insert the menu script for further display on the page.

Step 4

If the script is distributed as a JS file, you can also include it in your document:

In this case, "script_file" is responsible for the path to the directory where the document with the JS extension is located relative to the edited page.

Step 5

Thus, if you copied your script named script.js into the same folder where the HTML file is located, you just need to write:

Step 6

After editing the file and making the necessary changes to it, save the data using the "File" - "Save" menu and open the page in a browser to test the inserted code by right-clicking on the HTML file and selecting "Open with".

Recommended: