Searching for "he"

Q:

What is Javascript namespacing? How and where is it used?

Answer

Using global variables in Javascript is evil and a bad practice. That being said, namespacing is used to bundle up all your functionality using a unique name. In JavaScript, a namespace is really just an object that you’ve attached all further methods, properties and objects. It promotes modularity and code reuse in the application.

Report Error

View answer Workspace Report Error Discuss

Subject: Web Technology

Q:

Does javascript have the concept level scope?

Answer

No. JavaScript does not have block level scope, all the variables declared inside a function possess the same level of scope unlike c,c++,java.

Report Error

View answer Workspace Report Error Discuss

Subject: Web Technology

Q:

What is the difference between an alert box and a confirmation box?

Answer

An alert box displays only one button which is the OK button whereas the Confirm box displays two buttons namely OK and cancel.

Report Error

View answer Workspace Report Error Discuss

Subject: Web Technology

Q:

How to determine the state of a checkbox using Javascript?

Answer

var checkedP = window.document.getElementById("myCheckBox").checked;

Report Error

View answer Workspace Report Error Discuss

Subject: Web Technology

Q:

How to get the contents of an input box using Javascript?

Answer

Use the "value" property.
var myValue = window.document.getElementById("MyTextBox").value;

Report Error

View answer Workspace Report Error Discuss

Subject: Web Technology

Q:

Are Java and JavaScript the Same?

Answer

No.java and javascript are two different languages.
Java is a powerful object - oriented programming language like C++,C whereas Javascript is a client-side scripting language with some limitations.

Report Error

View answer Workspace Report Error Discuss

Subject: Web Technology

Q:

Where are cookies actually stored on the hard disk?

Answer

This depends on the user's browser and OS.
In the case of Netscape with Windows OS,all the cookies are stored in a single file called

cookies.txt
c:\Program Files\Netscape\Users\username\cookies.txt
In the case of IE,each cookie is stored in a separate file namely username@website.txt.
c:\Windows\Cookies\username@Website.txt

Report Error

View answer Workspace Report Error Discuss

Subject: Web Technology

Q:

If an array with name as "names" contain three elements, then how will you print the third element of this array?

Answer

Print third array element document.write(names[2]);

Note:- Array index starts with 0.

Report Error

View answer Workspace Report Error Discuss

Subject: Web Technology