This document provides an overview of JavaScript, including definitions of editors and web browsers, types of browsers, and advantages of using JavaScript over HTML. It outlines steps to create and run a simple JavaScript program, ways to include JavaScript in HTML, and discusses the interpreted nature of JavaScript and its case sensitivity. Additionally, it explains how to use multi-line comments and includes fill-in-the-blank exercises related to JavaScript concepts.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
11 views
Javascript section -1
This document provides an overview of JavaScript, including definitions of editors and web browsers, types of browsers, and advantages of using JavaScript over HTML. It outlines steps to create and run a simple JavaScript program, ways to include JavaScript in HTML, and discusses the interpreted nature of JavaScript and its case sensitivity. Additionally, it explains how to use multi-line comments and includes fill-in-the-blank exercises related to JavaScript concepts.
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3
UNIT 4 - JAVA SCRIPT
Notes
Q.1: What is an editor?
Editors or text editors are software programs that enable the user to create and edit text files. In the field of programming, the term editor usually refers to source code editors that include many special features for writing and editing code. Notepad, Wordpad are some of the common editors used on Windows OS and vi, emacs, Jed, pico are the editors on UNIX OS. Features normally associated with text editors are — moving the cursor, deleting, replacing, pasting, finding, finding and replacing, saving etc. Q.2: What do you understand by a web browser? A web browser takes you anywhere on the internet. It retrieves information from other parts of the web and displays it on your desktop or mobile device. The information is transferred using the Hypertext Transfer Protocol, which defines how text, images and video are transmitted on the web. Q.3: What are the major types of browser available today? Google Chrome. Mozilla Firefox. Microsoft Edge. Internet Explorer. Safari. Q.4: What is the advantage of using JavaScript over HTML? The content can be manipulated for creating dynamic pages with JavaScript. The page can be dynamic and interactive in real-time. We cannot manipulate the content present on a web page with HTML- it will be static. Q.5: What are the steps needed to create and run a simple program using JavaScript? Answer – Step 1 : Open Notepad file Step 2 : Write JavaScript code using HTML Step 3 : Save the file with file name using extension .html or .htm Step 4 : Open the location, where you have save the file Step 5 : Double Click on the file
Q. 6: Which attribute of the e <script> tag helps you include an external
JavaScript file? To include an external JavaScript file, we can use the script tag with the attribute src . You've already used the src attribute when using images. The value for the src attribute should be the path to your JavaScript file. This script tag should be included between the <head> tags in your HTML document.
Q. 7: What are the three ways in which JavaScript can be included?
Answer – The three way to include JavaScript in HTML are – a. External JavaScript – <script src=”file.js”></script> b. Internal JavaScript – <script> Write Script code</script> c. Inline JavaScript – <input type=”button” value=”Test” onClick=”function()” /> Q. 8: JavaScript is “interpreted” - what does this imply? An interpreted language is one that does not require compiling into machine language. It is executed by an interpreter who reads the source code and converts it into a form that is directly executed. The interpreter executes code line by line which makes JavaScript synchronous in nature. Q. 9: Explain the role of case sensitivity in JavaScript. JavaScript is a case-sensitive language. This means that language keywords, variables, function names, and any other identifiers must always be typed with a consistent capitalization of letters. The while keyword, for example, must be typed “while”, not “While” or “WHILE”.
Q. 10: how to use multiple line comments in JavaScript?
Multi-line comments in JavaScript code can be added by writing the comment between a forward-slash followed by asterisk /* and asterisk followed by a forward-slash */. Q. 11. Fill in the blanks (a) A file which ends with .js is a .......Java script file......................... . (b) Js programs are included within…… <script> & ........... </script> ................... of a HTML document. (c) generally HTML is preferred for creating ......... basic structure.................. while CSS is preferred for ....formatting................... and JavaScript is preferred for ......controlling elements........... ............... (d) JavaScript Syntax is a set of ........rules..................... that define a structured JavaScript. (e) comments are used to .........explain javascript code....................... in JavaScript program.
CODING FOR ABSOLUTE BEGINNERS: How to Keep Your Data Safe from Hackers by Mastering the Basic Functions of Python, Java, and C++ (2022 Guide for Newbies)