Javascript HTML Css
Javascript HTML Css
Answer :
Cascading Style Sheets, fondly referred to as CSS, is a simple design language intended to
simplify the process of making web pages presentable.
2. Question 2. What Are Advantages Of Using Css?
Answer :
Following are the advantages of using CSS −
•CSS saves time − You can write CSS once and then reuse same sheet in multiple HTML
pages. You can define a style for each HTML element and apply it to as many Web pages as
you want.
•Pages load faster − If you are using CSS, you do not need to write HTML tag attributes
every time. Just write one CSS rule of a tag and apply it to all the occurrences of that tag. So
less code means faster download times.
•Easy maintenance − To make a global change, simply change the style, and all elements in
all the web pages will be updated automatically.
•Superior styles to HTML − CSS has a much wider array of attributes than HTML, so you can
give a far better look to your HTML page in comparison to HTML attributes.
•Multiple Device Compatibility − Style sheets allow content to be optimized for more than
one type of device. By using the same HTML document, different versions of a website can
be presented for handheld devices such as PDAs and cell phones or for printing.
•Global web standards − Now HTML attributes are being deprecated and it is being
recommended to use CSS. So its a good idea to start using CSS in all the HTML pages to
make them compatible to future browsers.
•Offline Browsing − CSS can store web applications locally with the help of an offline
catche.Using of this, we can view offline websites.The cache also ensures faster loading and
better overall performance of the website.
•Platform Independence − The Script offer consistent platform independence and can support
latest browsers as well.
XML Interview Questions
3. Question 3. What Are The Components Of A Css Style?
Answer :
A style rule is made of three parts −
Selector − A selector is an HTML tag at which a style will be applied. This could be any tag
like <h1> or <table> etc.
Property − A property is a type of attribute of HTML tag. Put simply, all the HTML
attributes are converted into CSS properties. They could be color, border etc.
Value − Values are assigned to properties. For example, color property can have value either
red or #F1F1F1 etc.
4. Question 4. What Is Type Selector?
Answer :
Type selector quite simply matches the name of an element type. To give a color to all level 1
headings −
h1 {
color: #36CFFF;
}
XML Tutorial
5. Question 5. What Is Universal Selector?
Answer :
Rather than selecting elements of a specific type, the universal selector quite simply matches
the name of any element type
*{
color: #000000;
}
This rule renders the content of every element in our document in black.
CSS3 Interview Questions
6. Question 6. What Is Descendant Selector?
Answer :
Suppose you want to apply a style rule to a particular element only when it lies inside a
particular element. As given in the following example, style rule will apply to <em> element
only when it lies inside <ul> tag.
ul em {
color: #000000;
}
7. Question 7. What Is Class Selector?
Answer :
You can define style rules based on the class attribute of the elements. All the elements
having that class will be formatted according to the defined rule.
.black {
color: #000000;
}
This rule renders the content in black for every element with class attribute set to black in our
document.
CSS3 Tutorial HTML Interview Questions
8. Question 8. Can You Make A Class Selector Particular To An Element Type?
Answer :
You can make it a bit more particular. For example
h1.black
{
color: #000000;
}
This rule renders the content in black for only elements with class attribute set to black.
9. Question 9. What Is Id Selector?
Answer :
You can define style rules based on the id attribute of the elements. All the elements having
that id will be formatted according to the defined rule.
#black {
color: #000000;
}
This rule renders the content in black for every element with id attribute set to black in our
document.
10. Question 10. Can You Make A Id Selector Particular To An Element Type?
Answer :
can make it a bit more particular.
For example:
h1#black
{
color: #000000;
}
This rule renders the content in black for only elements with id attribute set to black.
HTML Tutorial
11. Question 11. What Is A Child Selector?
Answer :
Consider the following example:
body > p
{
color: #000000;
}
This rule will render all the paragraphs in black if they are direct child ofelement. Other
paragraphs put inside other elements like or would not have any effect of this rule.
UI Developer Interview Questions
12. Question 12. What Is An Attribute Selector?
Answer :
You can also apply styles to HTML elements with particular attributes. The style rule below
will match all the input elements having a type attribute with a value of text
input[type = "text"]
{
color: #000000;
}
Submit
The advantage to this method is that the element is unaffected, and the color applied
only to the desired text fields.
XML Interview Questions
13. Question 13. How To Select All Paragraph Elements With A Lang Attribute?
Answer :
p[lang] : Selects all paragraph elements with a lang attribute.
CSS Tutorial
14. Question 14. How To Select All Paragraph Elements Whose Lang Attribute Has A
Value Of Exactly "fr"?
Answer :
p[lang="fr"] - Selects all paragraph elements whose lang attribute has a value of exactly "fr".
15. Question 15. How To Select All Paragraph Elements Whose Lang Attribute Contains
The Word "fr"?
Answer :
p[lang~="fr"] - Selects all paragraph elements whose lang attribute contains the word "fr".
CSS Advanced Interview Questions
16. Question 16. How To Select All Paragraph Elements Whose Lang Attribute Contains
Values That Are Exactly "en", Or Begin With "en-"?
Answer :
p[lang|="en"] - Selects all paragraph elements whose lang attribute contains values that are
exactly "en", or begin with "en-".
CSS Advanced Tutorial
17. Question 17. What Are The Various Ways Of Using Css In An Html Page?
Answer :
There are four ways to associate styles with your HTML document. Most commonly used
methods are inline CSS and External CSS.
Embedded CSS − The
WordPress Interview Questions
18. Question 18. How Css Style Overriding Works?
Answer :
Following is the rule to override any Style Sheet Rule
Any inline style sheet takes highest priority. So, it will override any rule defined in
<style>...</style> tags or rules defined in any external style sheet file.
Any rule defined in <style>...</style> tags will override rules defined in any external style
sheet file.
Any rule defined in external style sheet file takes lowest priority, and rules defined in this file
will be applied only when above two rules are not applicable.
CSS3 Interview Questions
19. Question 19. What Is The Purpose Of % Measurement Unit?
Answer :
% - Defines a measurement as a percentage relative to another value, typically an enclosing
element.
p {font-size: 16pt; line-height: 125%;}
WordPress Tutorial
20. Question 20. What Is The Purpose Of Cm Measurement Unit?
Answer :
cm − Defines a measurement in centimeters.
div {margin-bottom: 2cm;}
Pure.CSS Interview Questions
21. Question 21. What Is The Purpose Of Em Measurement Unit?
Answer :
em − A relative measurement for the height of a font in em spaces. Because an em unit is
equivalent to the size of a given font, if you assign a font to 12pt, each "em" unit would be
12pt; thus, 2em would be 24pt.
p {letter-spacing: 7em;}
22. Question 22. What Is The Purpose Of Ex Measurement Unit?
Answer :
ex − This value defines a measurement relative to a font's x-height. The x-height is
determined by the height of the font's lowercase letter.
p {font-size: 24pt; line-height: 3ex;}
Pure.CSS Tutorial
23. Question 23. What Is The Purpose Of In Measurement Unit?
Answer :
in − Defines a measurement in inches.
p {word-spacing: .15in;}
XHTML Interview Questions
24. Question 24. What Is The Purpose Of Mm Measurement Unit?
Answer :
mm − Defines a measurement in millimeters.
p {word-spacing: 15mm;}
HTML Interview Questions
25. Question 25. What Is The Purpose Of Pc Measurement Unit?
Answer :
pc − Defines a measurement in picas. A pica is equivalent to 12 points; thus, there are 6 picas
per inch.
p {font-size: 20pc;}
XHTML Tutorial
26. Question 26. What Is The Purpose Of Pt Measurement Unit?
Answer :
pt − Defines a measurement in points. A point is defined as 1/72nd of an inch.
body {font-size: 18pt;}
27. Question 27. What Is The Purpose Of Px Measurement Unit?
Answer :
px − Defines a measurement in screen pixels.
p {padding: 25px;}
Dreamweaver Interview Questions
28. Question 28. What Is The Purpose Of Vh Measurement Unit?
Answer :
vh − 1% of viewport height.
h2 { font-size: 3.0vh; }
29. Question 29. What Is The Purpose Of Vw Measurement Unit?
Answer :
vw − 1% of viewport width.
h1 { font-size: 5.9vw; }
30. Question 30. What Is The Purpose Of Vmin Measurement Unit?
Answer :
vmin 1vw or 1vh, whichever is smaller.
p { font-size: 2vmin;}
31. Question 31. What Are Browser Safe Colors?
Answer :
There is the list of 216 colors which are supposed to be most safe and computer independent
colors. These colors vary from hexa code 000000 to FFFFFF. These colors are safe to use
because they ensure that all computers would display the colors correctly when running a 256
color palette.
32. Question 32. Which Property Is Used To Set The Background Color Of An Element?
Answer :
The background-color property is used to set the background color of an element.
33. Question 33. Which Property Is Used To Set The Background Image Of An Element?
Answer :
The background-image property is used to set the background image of an element.
UI Developer Interview Questions
34. Question 34. Which Property Is Used To Control The Repetition Of An Image In The
Background?
Answer :
The background-repeat property is used to control the repetition of an image in the
background.
35. Question 35. Which Property Is Used To Control The Position Of An Image In The
Background?
Answer :
The background-position property is used to control the position of an image in the
background.
36. Question 36. Which Property Is Used To Control The Scrolling Of An Image In The
Background?
Answer :
The background-attachment property is used to control the scrolling of an image in the
background.
CSS Advanced Interview Questions
37. Question 37. Which Property Is Used As A Shorthand To Specify A Number Of Other
Background Properties?
Answer :
The background property is used as a shorthand to specify a number of other background
properties.
38. Question 38. Which Property Is Used To Change The Face Of A Font?
Answer :
The font-family property is used to change the face of a font.
39. Question 39. Which Property Is Used To Make A Font Italic Or Oblique?
Answer :
The font-style property is used to make a font italic or oblique.
40. Question 40. Which Property Is Used To Create A Small-caps Effect?
Answer :
The font-variant property is used to create a small-caps effect.
WordPress Interview Questions
41. Question 41. Which Property Is Used To Increase Or Decrease How Bold Or Light A
Font Appears?
Answer :
The font-weight property is used to increase or decrease how bold or light a font appears.
42. Question 42. Which Property Is Used To Increase Or Decrease The Size Of A Font?
Answer :
The font-size property is used to increase or decrease the size of a font.
Pure.CSS Interview Questions
43. Question 43. Which Property Is Used As Shorthand To Specify A Number Of Other
Font Properties?
Answer :
The font property is used as shorthand to specify a number of other font properties.
44. Question 44. Which Property Is Used To Set The Color Of A Text?
Answer :
The color property is used to set the color of a text.
45. Question 45. Which Property Is Used To Set The Text Direction?
Answer :
The direction property is used to set the text direction.
46. Question 46. Which Property Is Used To Add Or Subtract Space Between The Letters
That Make Up A Word?
Answer :
The letter-spacing property is used to add or subtract space between the letters that make up a
word.
47. Question 47. Which Property Is Used To Add Or Subtract Space Between The Words
Of A Sentence?
Answer :
The word-spacing property is used to add or subtract space between the words of a sentence.
48. Question 48. Which Property Is Used To Indent The Text Of A Paragraph?
Answer :
The text-indent property is used to indent the text of a paragraph.
49. Question 49. Which Property Is Used To Align The Text Of A Document?
Answer :
The text-align property is used to align the text of a document.
50. Question 50. Which Property Is Used To Underline, Overline, And Strikethrough Text?
Answer :
The text-decoration property is used to underline, overline, and strikethrough text.
51. Question 51. Which Property Is Used To Capitalize Text Or Convert Text To Uppercase
Or Lowercase Letters?
Answer :
The text-transform property is used to capitalize text or convert text to uppercase or lowercase
letters.
52. Question 52. Which Property Is Used To Control The Flow And Formatting Of Text?
Answer :
The white-space property is used to control the flow and formatting of text.
53. Question 53. Which Property Is Used To Set The Text Shadow Around A Text?
Answer :
The text-shadow property is used to set the text shadow around a text.
54. Question 54. Which Property Is Used To Set The Width Of An Image Border?
Answer :
The border property is used to set the width of an image border.
55. Question 55. Which Property Is Used To Set The Height Of An Image?
Answer :
The height property is used to set the height of an image.
56. Question 56. Which Property Is Used To Set The Width Of An Image?
Answer :
The width property is used to set the width of an image.
57. Question 57. Which Property Is Used To Set The Opacity Of An Image?
Answer :
The -moz-opacity property is used to set the opacity of an image.
58. Question 58. Which Property Of A Hyperlink Signifies Unvisited Hyperlinks?
Answer :
The :link signifies unvisited hyperlinks.
59. Question 59. Which Property Of A Hyperlink Signifies Visited Hyperlinks?
Answer :
The :visited signifies visited hyperlinks.
60. Question 60. Which Property Of A Hyperlink Signifies An Element That Currently Has
The User's Mouse Pointer Hovering Over It?
Answer :
The :hover signifies an element that currently has the user's mouse pointer hovering over it.
==================HTML + JS=================
using the file name in the tag. If you have cat.jpg, use
o img src="cat.jpg">.
o Image file names are case-sensitive. If your file is called CaT.JpG, you
cannot type cat.jpg, you must type CaT.JpG exactly in the src.
o If all of the above fail, re-upload the image in BINARY mode. You may
have accidentally uploaded the image in ASCII mode.
HTML Tutorial
11. Question 11. How Do I Make A Frame With A Vertical Scrollbar But Without A
Horizontal Scrollbar?
Answer :
The only way to have a frame with a vertical scrollbar but without a horizontal
scrollbar is to define the frame with SCROLLING="auto" (the default), and to have
content that does not require horizontal scrolling. There is no way to specify that a
frame should have one scrollbar but not the other. Using SCROLLING="yes" will
force scrollbars in both directions (even when they aren't needed), and using
SCROLLING="no" will inhibit all scrollbars (even when scrolling is necessary to
access the frame's content). There are no other values for the SCROLLING attribute.
HTML+XHTML Interview Questions
12. Question 12. Are There Any Problems With Using Frames?
Answer :
The fundamental problem with the design of frames is that framesets create states in
the browser that are not addressable. Once any of the frames within a frameset
changes from its default content, there is no longer a way to address the current state
of the frameset. It is difficult to bookmark - and impossible to link or index - such a
frameset state. It is impossible to reference such a frameset state in other media. When
the sub-documents of such a frameset state are accessed directly, they appear without
the context of the surrounding frameset. Basic browser functions (e.g., printing,
moving forwards/backwards in the browser's history) behave differently with
framesets. Also, browsers cannot identify which frame should have focus, which
affects scrolling, searching, and the use of keyboard shortcuts in general.
Furthermore, frames focus on layout rather than on information structure, and many
authors of framed sites neglect to provide useful alternative content in the
NOFRAMES element. Both of these factors cause accessibility problems for browsers
that differ significantly from the author's expectations and for search engines.
XML Interview Questions
13. Question 13. How Do I Keep People From Stealing My Source Code And/or
Images?
Answer :
Because copies of your HTML files and images are stored in cache, it is impossible to
prevent someone from being able to save them onto their hard drive. If you are
concerned about your images, you may wish to embed a watermark with your
information into the image. Consult your image editing program's help file for more
details.
The colors on my page look different when viewed on a Mac and a PC. The Mac and
the PC use slightly different color palettes. There is a 216 "browser safe" color palette
that both platforms support; the Microsoft color picker page has some good
information and links to other resources about this. In addition, the two platforms use
different gamma (brightness) values, so a graphic that looks fine on the Mac may look
too dark on the PC. The only way to address this problem is to tweak the brightness of
your image so that it looks acceptable on both platforms.
HTML 5 Tutorial
14. Question 14. How Do You Create Tabs Or Indents In Web Pages?
Answer :
There was a tag proposed for HTML 3.0, but it was never adopted by any major
browser and the draft specification has now expired. You can simulate a tab or indent
in various ways, including using a transparent GIF, but none are quite as satisfactory
or widely supported as an official tag would be.
My page looks good on one browser, but not on another. There are slight differences
between browsers, such as Netscape Navigator and Microsoft Internet Explorer, in
areas such as page margins. The only real answer is to use standard HTML tags
whenever possible, and view your pages in multiple browsers to see how they look.
15. Question 15. How Do I Make Sure My Framed Documents Are Displayed Inside
Their Frame Set?
Answer :
When the sub-documents of a frameset state are accessed directly, they appear without
the context of the surrounding frameset.
If the reader's browser has JavaScript support enabled, the following script will restore
the frameset:
<SCRIPT TYPE="text/javascript">
if (parent.location.href == self.location.href) {
if (window.location.href.replace)
window.location.replace('frameset.html');
else
// causes problems with back button, but works
window.location.href = 'frameset.html';
}
</SCRIPT>
A more universal approach is a "restore frames" link:
<A HREF="frameset.html" TARGET="_top">Restore Frames
Note that in either case, you must have a separate frameset document for every content
document. If you link to the default frameset document, then your reader will get the
default content document, rather than the content document he/she was trying to
access. These frameset documents should be generated automatically, to avoid the
tedium and inaccuracy of creating them by hand.
Note that you can work around the problem with bookmarking frameset states by
linking to these separate frameset documents using TARGET="_top", rather than
linking to the individual content documents.
Java Tutorial
17. Question 17. What Is Html?
Answer :
HTML, or HyperText Markup Language, is a Universal language which allows an
individual using special code to create web pages to be viewed on the Internet.
HTML ( H yper T ext M arkup L anguage) is the language used to write Web pages.
You are looking at a Web page right now.
You can view HTML pages in two ways:
o One view is their appearance on a Web browser, just like this page -- colors,
different text sizes, graphics.
o The other view is called "HTML Code" -- this is the code that tells the
browser what to do.
Java Interview Questions
18. Question 18. What Is A Tag?
Answer :
In HTML, a tag tells the browser what to do. When you write an HTML page, you
enter tags for many reasons -- to change the appearance of text, to show a graphic, or
to make a link to another page.
CSS Tutorial
20. Question 20. How Do I Create Frames? What Is A Frameset?
Answer :
Frames allow an author to divide a browser window into multiple (rectangular)
regions. Multiple documents can be displayed in a single window, each within its own
frame. Graphical browsers allow these frames to be scrolled independently of each
other, and links can update the document displayed in one frame without affecting the
others.
You can't just "add frames" to an existing document. Rather, you must create a
frameset document that defines a particular combination of frames, and then display
your content documents inside those frames. The frameset document should also
include alternative non-framed content in a NOFRAMES element.
The HTML 4 frames model has significant design flaws that cause usability problems
for web users. Frames should be used only with great care.
CSS Interview Questions
21. Question 21. What Is A Hypertext Link?
Answer :
A hypertext link is a special tag that links one page to another page or resource. If you
click the link, the browser jumps to the link's destination.
22. Question 22. What Does Break And Continue Statements Do?
Answer :
Continue statement continues the current loop (if label not specified) in a new iteration
whereas break statement exits the current loop.
XHTML Tutorial
23. Question 23. How To Create A Function Using Function Constructor?
Answer :
The following example illustrates this
It creates a function called square with argument x and returns x multiplied by itself.
var square = new Function ("x","return x*x");
Java Abstraction Interview Questions
24. Question 24. How To Make A Array As A Stack Using Javascript?
Answer :
The pop() and push() functions turn a harmless array into a stack
<script type="text/javascript">
var numbers = ["one", "two", "three", "four"];
numbers.push("five");
numbers.push("six");
document.write(numbers.pop());
document.write(numbers.pop());
document.write(numbers.pop());
</script>
This produces
sixfivefour
HTML Interview Questions
25. Question 25. How To Shift And Unshift Using Javascript?
Answer :
<script type="text/javascript">
var numbers = ["one", "two", "three", "four"];
numbers.unshift("zero");
document.write(" "+numbers.shift());
document.write(" "+numbers.shift());
document.write(" "+numbers.shift());
</script>
This produces
zero one two
shift, unshift, push, and pop may be used on the same array. Queues are easily
implemented using combinations.
26. Question 26. What Are Javascript Types?
Answer :
Number, String, Boolean, Function, Object, Null, Undefined.
Dynamic HTML Interview Questions
27. Question 27. How Do You Convert Numbers Between Different Bases In
Javascript?
Answer :
Use the parseInt() function, that takes a string as the first parameter, and the base as a
second parameter. So to convert hexadecimal 3F to decimal, use parseInt ("3F", 16);
HTML 5 Interview Questions
28. Question 28. How To Create Arrays In Javascript?
Answer :
We can declare an array like this
var scripts = new Array();
We can add elements to this array like this
scripts[0] = "PHP";
scripts[1] = "ASP";
scripts[2] = "JavaScript";
scripts[3] = "HTML";
Now our array scrips has 4 elements inside it and we can print or access them by using
their index number. Note that index number starts from 0. To get the third element of
the array we have to use the index number 2 . Here is the way to get the third element
of an array.
document.write(scripts[2]);
We also can create an array like this
var no_array = new Array(21, 22, 23, 24, 25);
29. Question 29. How Do You Target A Specific Frame From A Hyperlink?
Answer :
Include the name of the frame in the target attribute of the hyperlink. <a
href=”mypage.htm” target=”myframe”>>My Page</a>
XHTML Interview Questions
30. Question 30. What Can Javascript Programs Do?
Answer :
Generation of HTML pages on-the-fly without accessing the Web server. The user can
be given control over the browser like User input validation Simple computations can
be performed on the client's machine The user's browser, OS, screen size, etc. can be
detected Date and Time Handling
31. Question 31. How To Set A Html Document's Background Color?
Answer :
document.bgcolor property can be set to any appropriate color.
32. Question 32. How Can Javascript Be Used To Personalize Or Tailor A Web Site
To Fit Individual Users?
Answer :
JavaScript allows a Web page to perform "if-then" kinds of decisions based on
browser version, operating system, user input, and, in more recent browsers, details
about the screen size in which the browser is running. While a server CGI program
can make some of those same kinds of decisions, not everyone has access to or the
expertise to create CGI programs. For example, an experienced CGI programmer can
examine information about the browser whenever a request for a page is made; thus a
server so equipped might serve up one page for Navigator users and a different page
for Internet Explorer users. Beyond browser and operating system version, a CGI
program can't know more about the environment. But a JavaScript-enhanced page can
instruct the browser to render only certain content based on the browser, operating
system, and even the screen size.
Scripting can even go further if the page author desires. For example, the author may
include a preference screen that lets the user determine the desired background and
text color combination. A script can save this information on the client in a well-
regulated local file called a cookie. The next time the user comes to the site, scripts in
its pages look to the cookie info and render the page in the color combination selected
previously. The server is none the wiser, nor does it have to store any visitor-specific
information.
33. Question 33. Are You Concerned That Older Browsers Don't Support Javascript
And Thus Exclude A Set Of Web Users? Individual Users?
Answer :
Fragmentation of the installed base of browsers will only get worse. By definition, it
can never improve unless absolutely everyone on the planet threw away their old
browsers and upgraded to the latest gee-whiz versions. But even then, there are plenty
of discrepancies between the scriptability of the latest Netscape Navigator and
Microsoft Internet Explorer.
The situation makes scripting a challenge, especially for newcomers who may not be
aware of the limitations of earlier browsers. A lot of effort in my books and ancillary
material goes toward helping scripters know what features work in which browsers
and how to either workaround limitations in earlier browsers or raise the compatibility
common denominator.
Designing scripts for a Web site requires making some hard decisions about if, when,
and how to implement the advantages scripting offers a page to your audience. For
public Web sites, I recommend using scripting in an additive way: let sufficient
content stand on its own, but let scriptable browser users receive an enhanced
experience, preferably with the same HTML document.
HTML+XHTML Interview Questions
34. Question 34. What Does Isnan Function Do?
Answer :
Return true if the argument is not a number.
35. Question 35. What Is Negative Infinity?
Answer :
It’s a number in JavaScript, derived by dividing negative number by zero.
36. Question 36. In A Pop-up Browser Window, How Do You Refer To The Main
Browser Window That Opened It?
Answer :
Use window.opener to refer to the main window from pop-ups.
HTML DOM Interview Questions
37. Question 37. What Is The Data Type Of Variables Of In Javascript?
Answer :
All variables are of object type in JavaScript.
38. Question 38. Methods Get And Post In Html Forms - What's The Difference?
Answer :
o GET: Parameters are passed in the querystring. Maximum amount of data
that can be sent via the GET method is limited to about 2kb.
o POST: Parameters are passed in the request body. There is no limit to the
amount of data that can be transferred using POST. However, there are
limits on the maximum amount of data that can be transferred in one
name/value pair.
39. Question 39. How To Write A Script For "select" Lists Using Javascript
Answer :
1. To remove an item from a list set it to null.
mySelectObject.options[3] = null;
2. To truncate a list set its length to the maximum size you desire.
mySelectObject.length = 2;
3. To delete all options in a select object set the length to 0.
mySelectObject.leng
40. Question 40. Text From Your Clipboard?
Answer :
It is true, text you last copied for pasting (copy & paste) can be stolen when you visit
web sites using a combination of JavaScript and ASP (or PHP, or CGI) to write your
possible sensitive data to a database on another server.
41. Question 41. What Does The "access Is Denied" Ie Error Mean?
Answer :
The "Access Denied" error in any browser is due to the following reason.
A javascript in one window or frame is tries to access another window or frame whose
document's domain is different from the document containing the script.
42. Question 42. Is A Javascript Script Faster Than An Asp Script?
Answer :
Yes.Since javascript is a client-side script it does require the web server's help for its
computation,so it is always faster than any server-side script like ASP,PHP,etc..
43. Question 43. 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.
44. Question 44. How To Embed Javascript In A Web Page?
Answer :
javascript code can be embedded in a web page between <script
langugage="javascript"></script> tags
45. Question 45. What And Where Are The Best Javascript Resources On The Web?
Answer :
The best place to start is something called the meta- which provides a high-level
overview of the JavaScript help available on the Net.
For interactive help with specific problems, nothing beats the primary JavaScript
Usenet newsgroup, comp.lang.javascript. Netscape and Microsoft also have vendor-
specific developer discussion groups as well as detailed documentation for the
scripting and object model implementations.
46. Question 46. What Are The Problems Associated With Using Javascript, And
Are There Javascript Techniques That You Discourage?
Answer :
Browser version incompatibility is the biggest problem. It requires knowing how each
scriptable browser version implements its object model. You see, the incompatibility
rarely has to do with the core JavaScript language (although there have been
improvements to the language over time); the bulk of incompatibility issues have to do
with the object models that each browser version implements. For example, scripters
who started out with Navigator 3 implemented the image rollover because it looked
cool. But they were dismayed to find out that the image object wasn't scriptable in
Internet Explorer 3 or Navigator 2. While there are easy workarounds to make this
feature work on newer browsers without disturbing older ones, it was a painful
learning experience for many.
The second biggest can of worms is scripting connections between multiple windows.
A lot of scripters like to have little windows pop up with navigation bars or some such
gizmos. But the object models, especially in the older browser versions, don't make it
easy to work with these windows the minute you put a user in front of them--users
who can manually close windows or change their stacking order. More recently, a
glitch in some uninstall routines for Windows 95 applications can disturb vital parts of
the system Registry that Internet Explorer 4 requires for managing multiple windows.
A scripter can't work around this problem, because it's not possible to detect the
problem in a user's machine. I tend to avoid multiple windows that interact with each
other.
47. Question 47. What Boolean Operators Does Javascript Support?
Answer :
o &&
o ||
o !
48. Question 48. What Does "1"+2+4 Evaluate To?
Answer :
Since 1 is a string, everything is a string, so the result is 124.
49. Question 49. What Is The Difference Between A Web-garden And A Web-farm?
Answer :
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 web-server for scalability and performance (contrast this with web-garden
which refers to multiple processes on one single physical machine).
50. Question 50. How To Get The Contents Of An Input Box Using Javascript?
Answer :
Use the "value" property.
var myValue = window.document.getElementById("MyTextBox").value;
51. Question 51. How To Determine The State Of A Checkbox Using Javascript?
Answer :
var checkedP = window.document.getElementById("myCheckBox").checked;
52. Question 52. How To Set The Focus In An Element Using Javascript?
Answer :
<script> function setFocus() { if(focusElement != null) {
document.forms[0].elements["myelementname"].focus(); } } </script>
53. Question 53. How To Access An External Javascript File That Is Stored
Externally And Not Embedded?
Answer :
This can be achieved by using the following tag between head tags or between body
tags.
<script src="abc.js"></script>
54. Question 54. 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.
55. Question 55. What Is A Prompt Box?
Answer :
A prompt box allows the user to enter input by providing a text box.
56. Question 56. Can Javascript Code Be Broken In Different Lines?
Answer :
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");
57. Question 57. Taking A Developer’s Perspective, Do You Think That That
Javascript Is Easy To Learn And Use?
Answer :
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.
58. Question 58. What Web Sites Do You Feel Use Javascript Most Effectively (i.e.,
Best-in-class Examples)? The Worst?
Answer :
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.
59. Question 59. What Is The Difference Between Sessionstate And Viewstate?
Answer :
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.
60. Question 60. What Does The Enableviewstatemac Setting In An Aspx Page Do?
Answer :
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.