Вы находитесь на странице: 1из 5

6/23/2014

Java Script Interview Questions And Answers

Home Interview Questions Certifications Aptitude Questions Tutorials Placement Papers Search
Resume Soft Skills Video Forum Blog

Google Search

Technical Interview Questions

Oracle Interview Questions


J2EE Interview Questions
C++ Interview Questions
XML Interview Questions
EJB Interview Questions
JSP Interview Questions
.........More

Javascript Interview Questions and Answers

Programming Source Codes

Java Source Codes


Html Source Codes
CSS Source Codes
C Source Codes
.........More

Soft Skills

Communication Skills
Leadership Skills
.........More

What is the difference


between a webgarden and a webfarm?

Web-garden - An
IIS6.0 feature where
you can configure an
application pool as a
web-garden and also
specify the number of
worker processes for
that pool. It can help
improve performance
in some cases.
Web-farm - a general
term referring to a
cluster of physically
separate machines,
each running a webserver for scalability
and performance
(contrast this with
web-garden which
refers to multiple
processes on one
single physical
machine).
How to get the
contents of an input
box using Javascript?

Use the "value"


property.
var myValue =

http://techpreparation.com/computer-interview-questions/javascript-interview-questions-answers5.htm#.U6gvLPmSwiQ

1/5

6/23/2014

Java Script Interview Questions And Answers

http://techpreparation.com/computer-interview-questions/javascript-interview-questions-answers5.htm#.U6gvLPmSwiQ

2/5

6/23/2014

Java Script Interview Questions And Answers

window.document.getElementById("MyTextBox").value;
How to determine the state of a checkbox using Javascript?

var checkedP =
window.document.getElementById("myCheckBox").checked;
How to set the focus in an element using Javascript?

<script> function setFocus() { if(focusElement != null) {


document.forms[0].elements["myelementname"].focus(); } }
</script>
How to access an external javascript file that is stored
externally and not embedded?

This can be achieved by using the following tag between head tags
or between body tags.
<script src="abc.js"></script>How to access an external javascript
file that is stored externally and not embedded? where abc.js is
http://techpreparation.com/computer-interview-questions/javascript-interview-questions-answers5.htm#.U6gvLPmSwiQ

3/5

6/23/2014

Java Script Interview Questions And Answers

the external javscript file to be accessed.


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

An alert box displays only one button which is the OK button


whereas the Confirm box displays two buttons namely OK and
cancel.
What is a prompt box?

A prompt box allows the user to enter input by providing a text box.
Can javascript code be broken in different lines?

Breaking is possible within a string statement by using a


backslash \ at the end but not within any other javascript
statement.
that is ,
document.write("Hello \ world");
is possible but not document.write \
("hello world");
Taking a developers perspective, do you think that that
JavaScript is easy to learn and use?

One of the reasons JavaScript has the word "script" in it is that as a


programming language, the vocabulary of the core language is
compact compared to full-fledged programming languages. If you
already program in Java or C, you actually have to unlearn some
concepts that had been beaten into you. For example, JavaScript is
a loosely typed language, which means that a variable doesn't care
if it's holding a string, a number, or a reference to an object; the
same variable can even change what type of data it holds while a
script runs.
The other part of JavaScript implementation in browsers that
makes it easier to learn is that most of the objects you script are
pre-defined for the author, and they largely represent physical
things you can see on a page: a text box, an image, and so on. It's
easier to say, "OK, these are the things I'm working with and I'll
use scripting to make them do such and such," instead of having
to dream up the user interface, conceive of and code objects, and
handle the interaction between objects and users. With scripting,
you tend to write a _lot_ less code.
What Web sites do you feel use JavaScript most effectively
(i.e., best-in-class examples)? The worst?

The best sites are the ones that use JavaScript so transparently,
that I'm not aware that there is any scripting on the page. The
worst sites are those that try to impress me with how much
scripting is on the page.
http://techpreparation.com/computer-interview-questions/javascript-interview-questions-answers5.htm#.U6gvLPmSwiQ

4/5

6/23/2014

Java Script Interview Questions And Answers

How about 2+5+"8"?

Since 2 and 5 are integers, this is number arithmetic, since 8 is a


string, its concatenation, so 78 is the result.
What is the difference between SessionState and ViewState?

ViewState is specific to a page in a session. Session state refers to


user specific data that can be accessed across all pages in the web
application.
What does the EnableViewStateMac setting in an aspx page
do?

Setting EnableViewStateMac=true is a security measure that


allows ASP.NET to ensure that the viewstate for a page has not
been tampered with. If on Postback, the ASP.NET framework
detects that there has been a change in the value of viewstate that
was sent to the browser, it raises an error - Validation of viewstate
MAC failed.
Use <% @ Page EnableViewStateMac="true"% > to set it to true (the
default value, if this attribute is not specified is also true) in an
aspx page.
Page Numbers : 1
9
10
11
12

2
13

Have a Question ? post your questions here. It will be answered


as soon as possible.
Check Java Interview Questions for more Java Interview
Questions with answers
Check Structs Interview Questions for more Structs Interview
Questions with answers
Check Servlet Interview Questions for more Servlet Interview
Questions with answers

18

http://techpreparation.com/computer-interview-questions/javascript-interview-questions-answers5.htm#.U6gvLPmSwiQ

5/5

Вам также может понравиться