You are on page 1of 2

SCRIPTING CHAPTER – 10

1.Q. What is scripting language?


Ans. Script is normally a short program rather a sequence of instructions which are interpreted.
The scripting language runs in an environment which contains a script language interpreter.
2.Q. What is An Interpreter?
Ans. An Interpreter is a program which interprets and executes the script line by line.
3.Q. Define Client side Scripting.
Ans. These are the programs which are executed at users’ computer by user’s browser. The
commonly used client scripting languages are ECMA Script, JavaScript , VBScript and PHP.
4.Q. Define Server-side Scripting.
Ans. These are the programs which run at server computer. It usually accesses interactive
website and interface with databases. Few popular server scripting programs are ASP, JSP,
PHP, Python.
5.Q. What is JavaScript? Write some characteristics of JavaScript.
Ans. JavaScript is scripting language developed by Netscape Communication corporation. It
is a platform independent and can run on Windows, Linux etc. All commonly used browsers
support JavaScript.
Characteristics:
• Scripting language - It is a simple programming language with limited features of full-
fledge programming language and is easy to learn and understand.
• Object based - It depends on collection of built-in objects for functionality.
• Platform independent -It is interpreted by almost browsers.
6.Q. Write the ways to embed Java Script in HTML.
Ans. There are two ways to include JavaScript in HTML. One way, you can store your script
in a separate text file and include this file in HTML document other way, you can directly
write your script inside HTML document.
Q.7. What is an operator? Describe different operators in JavaScript.
Ans. An operator is used to transform one or more values into a single resultant value. These
are used in expressions to calculate/store or return a value.
Operators are classified as:
• Arithmetic Operator
• Assignment Operator
• Logical Operator
• Comparison Operator
• String Operator
Q. 8. What is Variables in JavaScript?
Ans. Variable is a name given to storage area which is capable of storing text, numbers
including decimals in JavaScript. In JavaScript, variable can store number, string, boolean
values data types.
Q. 9. Define Function in JavaScript.
Ans. A function is a block of code designed to perform a specific task. Code written in function
block are reusable, which can be called anywhere in the program.
Q. 10. Explain the use of event handling? Give example.
Ans. Event is an action when a user interacts with a web page or other browser related
activities. The action taken by the browser is called Event Handling.
For example, when a user clicks a mouse or enters data in a form, an event is generated. The
browser waits for an event to occur, takes action based on the type of event.
Q. 11. Write a script program to display sum of numbers from 20 to 50.
Ans.
<html>
<body>
<script>
var i, sum=0;
for(i=20; i<=50; i++)
sum = sum+i;
document.write(sum);
</script>
</body>
</html>

You might also like