Tuesday, February 2, 2010

What is JavaScript?

JavaScript is a scripting language most often used for client-side web development.

What boolean operators does JavaScript support?

Answer
==
!=
<
>
<=
>=

Is a javascript script faster than an ASP script?  

Answer
JSP is faster then ASP as the script is run on the client side. Only the computation is done on the server side.

What is == operator ?     

Answer
The ‘==’ operator is a boolean comparison operator that returns true if the variables on its both sides are compared equal else it returns false.

What is negative infinity?

Answer
It’s a number that is obtained by dividing a negative number by zero. (in JSP)

What’s relationship between JavaScript and ECMAScript?

Answer
JavaScript is a scripting language most often used for client-side web development. It was the originating dialect of the ECMAScript standard. ECMAScript and LiveScript are other names for JavaScript. The current JavaScript that is supported in browsers is ECMAScript revision 3.

What does isNaN function do?

Answer
The isNaN function determines if the value is a number or not and depending upon the result, it returns true or false.

How to read and write a file using javascript?

There are two ways to do it:
1. Using JavaScript extensions (runs from JavaScript Editor), or
2. Using a web page and ActiveX objects (Internet Explorer only)
In JavaScript Extensions, you can use
fh = fopen(getScriptPath(), 0); to open a file
Using ActiveX objects, following should be included in your code to read a file:
var fso = new ActiveXObject("Scripting.FileSystemObject");
var s = fso.OpenTextFile("C:\\example.txt", 1, true);

0 Comments: