41
UNIT-II PART – A 1.What is CSS (Cascading Style Sheets)? 1. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. Every element type as well as every occurrence of a specific element within that type can be declared an unique style, e.g. margins, positioning, color or size. 2. CSS is a web standard that describes style for XML/HTML documents. 3. CSS is a language that adds style (colors, images, borders, margins…) to your site. It’s really that simple. CSS is not used to put any content on your site, it’s just there to take the content you have and make it pretty. First thing you do is link a CSS-file to your HTML document. Do this by adding this line: <link rel="stylesheet" href="style.css" type="text/css"> The line should be placed in between your <head> and </head> tags. If you have several pages you could add the exact same line to all of them and they will all use the same stylesheet, but more about that later. Let’s look inside the file “style.css” we just linked to. h1 { font-size: 40px; height: 200px; } .warning { color: Red;

IT 2353 Unit II 2Marks

  • Upload
    shankar

  • View
    204

  • Download
    15

Embed Size (px)

Citation preview

Page 1: IT 2353 Unit II 2Marks

UNIT-II

PART – A

 1.What is CSS (Cascading Style Sheets)?

1. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. Every element type as well as every occurrence of a specific element within that type can be declared an unique style, e.g. margins, positioning, color or size.

2. CSS is a web standard that describes style for XML/HTML documents.

3. CSS is a language that adds style (colors, images, borders, margins…) to your site. It’s really that simple. CSS is not used to put any content on your site, it’s just there to take the content you have and make it pretty. First thing you do is link a CSS-file to your HTML document. Do this by adding this line:

<link rel="stylesheet" href="style.css"type="text/css">

The line should be placed in between your <head> and </head> tags. If you have several pages you could add the exact same line to all of them and they will all use the same stylesheet, but more about that later. Let’s look inside the file “style.css” we just linked to.

h1 {font-size: 40px;height: 200px;}.warning {color: Red;font-weight: bold;}#footer {background-color: Gray;}

4. Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g. fonts, colors, spacing) to Web documents. This is also where information meets the artistic abilities of a web-designer. CSS helps you spice up your web-page and make it look neat in wide variety of aspects.

Page 2: IT 2353 Unit II 2Marks

2.What are the advantages and disadvantages of Cascading Style Sheets?

Advantages Greater Control. Style sheets allow far greater control over the appearance of a document. Many different elements can be defined and customised, including margins, indents, font size, line and letter spacing. In addition, elements can be positioned absolutely on the page.

Disadvantages

Browser Support. This is the one major drawback to style sheets. They are only supported at all by IE 3 and above and Netscape 4 and above, but even then, the way in which the two browsers interpret them can vary considerably. However, older browsers will still display your website, simply ignoring the elements they do not understand.

3.How do i center block-elements with CSS?

There are two ways of centering block level elements:

By setting the properties margin-left and margin-right to auto and width to some explicit value:

BODY {width: 30em; background: cyan;} P {width: 22em; margin-left: auto; margin-right: auto}

In this case, the left and right margins will each be four ems wide, since they equally split up the eight ems left over from (30em - 22em). Note that it was not necessary to set an explicit width for the BODY element; it was done here to keep the math clean.

Another example:

TABLE {margin-left: auto; margin-right: auto; width: 400px;}

In most legacy browsers, a table's width is by default determined by its content. In CSS-conformant browsers, the complete width of any element (including tables) defaults to the full width of its parent element's content area. As browser become more conformant, authors will need to be aware of the potential impact on their designs.

Page 3: IT 2353 Unit II 2Marks

4.If background and color should always be set together, why do they exist as separate properties?

There are several reasons for this. First, style sheets become more legible -- both for humans and machines. The background property is already the most complex property in CSS1 and combining it with color would make it even more complex. Second, color inherits, but background doesn't and this would be a source of confusion.

5.What is class?

Class is a group of 1) instances of the same element to which an unique style can be attached or 2) instances of different elements to which the same style can be attached.

1) The rule P {color: red} will display red text in all paragraphs. By classifying the selector P different style can be attached to each class allowing the display of some paragraphs in one style and some other paragraphs in another style.

2) A class can also be specified without associating a specific element to it and then attached to any element which is to be styled in accordance with it's declaration. All elements to which a specific class is attached will have the same style.

To classify an element add a period to the selector followed by an unique name. The name can contain characters a-z, A-Z, digits 0-9, period, hyphen, escaped characters, Unicode characters 161-255, as well as any Unicode character as a numeric code, however, they cannot start with a dash or a digit. (Note: in HTML the value of the CLASS attribute can contain more characters). (Note: text between /* and */ are my comments).

CSSP.name1 {color: red} /* one class of P selector */P.name2 {color: blue} /* another class of P selector */.name3 {color: green} /* can be attached to any element */

HTML<P class=name1>This paragraph will be red</P><P class=name2>This paragraph will be blue</P><P class=name3>This paragraph will be green</P>

Page 4: IT 2353 Unit II 2Marks

<LI class=name3>This list item will be green</LI>

It is a good practice to name classes according to their function than their appearance; e.g. P.fotnote and not P.green. In CSS1 only one class can be attached to a selector. CSS2 allows attaching more classes, e.g.: P.name1.name2.name3 {declaration} <P class="name1 name2 name2">This paragraph has three classes attached</P>

6.What is grouping ?

Grouping is gathering (1) into a comma separated list two or more selectors that share the same style or (2) into a semicolon separated list two or more declarations that are attached to the same selector (2).

1. The selectors LI, P with class name .first and class .footnote share the same style, e.g.:LI {font-style: italic}P.first {font-style: italic}.footnote {font-style: italic}

To reduce the size of style sheets and also save some typing time they can all be grouped in one list.LI, P.first, .footnote {font-style: italic}

2. The declarations {font-style: italic} and {color: red} can be attached to one selector, e.g.:H2 {font-style: italic}H2 {color: red}and can also be grouped into one list:H2 {font-style: italic; color: red}

7.What is external Style Sheet? How to link?

External Style Sheet is a template/document/file containing style information which can be linked with any number of HTML documents. This is a very convenient way of formatting the entire site as well as restyling it by editing just one file. The file is linked with HTML documents via the LINK element inside the HEAD

Page 5: IT 2353 Unit II 2Marks

element. Files containing style information must have extension .css, e.g. style.css. <HEAD> <LINK REL=STYLESHEET HREF="style.css" TYPE="text/css"> </HEAD>

8.Is CSS case sensitive?

Cascading Style Sheets (CSS) is not case sensitive. However, font families, URLs to images, and other direct references with the style sheet may be.The trick is that if you write a document using an XML declaration and an XHTML doctype, then the CSS class names will be case sensitive for some browsers.

It is a good idea to avoid naming classes where the only difference is the case, for example:

div.myclass { ...}div.myClass { ... }

If the DOCTYPE or XML declaration is ever removed from your pages, even by mistake, the last instance of the style will be used, regardless of case.

9.What are Style Sheets?

Style Sheets are templates, very similar to templates in desktop publishing applications, containing a collection of rules declared to various selectors (elements).

Style sheets are the way that standards-compliant Web designers define the layout, look-and-feel, and design of their pages. They are called Cascading Style Sheets or CSS. With style sheets, a designer can define many aspects of a Web page:

* fonts* colors* layout* positioning* imagery* accessibility

Style sheets give you a lot of power to define how your pages will look. And

Page 6: IT 2353 Unit II 2Marks

another great thing about them is that style sheets make it really easy to update your pages when you want to make a new design. Simply load in a new style sheet onto your pages and you're done.

10.What is CSS rule 'ruleset'?

There are two types of CSS rules: ruleset and at-rule. Ruleset identifies selector or selectors and declares style which is to be attached to that selector or selectors. For example P {text-indent: 10pt} is a CSS rule. CSS rulesets consist of two parts: selector, e.g. P and declaration, e.g. {text-indent: 10pt}.

P {text-indent: 10pt} - CSS rule (ruleset){text-indent: 10pt} - CSS declarationtext-indent - CSS property10pt - CSS value

11.What is embedded style? How to link?

Embedded style is the style attached to one specific document. The style information is specified as a content of the STYLE element inside the HEAD element and will apply to the entire document.

<HEAD><STYLE TYPE="text/css"><!--P {text-indent: 10pt}--></STYLE></HEAD>

Note: The styling rules are written as a HTML comment, that is, between <!-- and --> to hide the content in browsers without CSS support which would otherwise be displayed.

Page 7: IT 2353 Unit II 2Marks

12.What is ID selector?

ID selector is an individually identified (named) selector to which a specific style is declared. Using the ID attribute the declared style can then be associated with one and only one HTML element per document as to differentiate it from all other elements. ID selectors are created by a character # followed by the selector's name. The name can contain characters a-z, A-Z, digits 0-9, period, hyphen, escaped characters, Unicode characters 161-255, as well as any Unicode character as a numeric code, however, they cannot start with a dash or a digit.

#abc123 {color: red; background: black}

<P ID=abc123>This and only this element can be identified as abc123 </P>

13.What is contextual selector?

Contextual selector is a selector that addresses specific occurrence of an element. It is a string of individual selectors separated by white space, a search pattern, where only the last element in the pattern is addressed providing it matches the specified context.

TD P CODE {color: red}

The element CODE will be displayed in red but only if it occurs in the context of the element P which must occur in the context of the element TD.

TD P CODE, H1 EM {color: red}

The element CODE will be displayed in red as described above AND the element EM will also be red but only if it occurs in the context of H1

P .footnote {color: red}

Any element with CLASS footnote will be red but only if it occurs in the context of P

P .footnote [lang]{color: red}

Any element with attribute LANG will be red but only if it is classed as "footnote" and occurs in the context of P

Page 8: IT 2353 Unit II 2Marks

14.How do I have a background image that isn't tiled?

Specify the background-repeat property as no-repeat. You can also use the background property as a shortcut for specifying multiple background-* properties at once. Here's an example:

BODY {background: #FFF url(watermark.jpg) no-repeat;}

15.What is inline style? How to link?

Inline style is the style attached to one specific element. The style is specified directly in the start tag as a value of the STYLE attribute and will apply exclusively to this specific element occurrence.

<P STYLE="text-indent: 10pt">Indented paragraph</P>

16.What is imported Style Sheet? How to link?

Imported Style Sheet is a sheet that can be imported to (combined with) another sheet. This allows creating one main sheet containing declarations that apply to the whole site and partial sheets containing declarations that apply to specific elements (or documents) that may require additional styling. By importing partial sheets to the main sheet a number of sources can be combined into one.

To import a style sheet or style sheets include the @import notation or notations in the STYLE element.

The @import notations must come before any other declaration.

If more than one sheet is imported they will cascade in order they are imported - the last imported sheet will override the next last; the next last will override the second last, and so on.

If the imported style is in conflict with the rules declared in the main sheet then it will be overridden.

Page 9: IT 2353 Unit II 2Marks

<LINK REL=STYLESHEET HREF="main.css" TYPE="text/css"><STYLE TYPE="text=css"><!--@import url(http://www.and.so.on.partial1.css);@import url(http://www.and.so.on.partial2.css);.... other statements--></STYLE>

17.What is alternate Style Sheet? How to link?

Alternate Style Sheet is a sheet defining an alternate style to be used in place of style(s) declared as persistent and/or preferred .Persistent style is a default style that applies when style sheets are enabled but can disabled in favor of an alternate style, e.g.:

<LINK REL=Stylesheet HREF="style.css" TYPE="text/css">

Preferred style is a default style that applies automatically and is declared by setting the TITLE attribute to the LINK element. There can only be one preferred style, e.g.:

<LINK REL=Stylesheet HREF="style2.css" TYPE="text/css" TITLE="appropriate style description">

Alternate style gives an user the choice of selecting an alternative style - a very convenient way of specifying a media dependent style. Note: Each group of alternate styles must have unique TITLE, e.g.:

<LINK REL="Alternate Stylesheet" HREF="style3.css" TYPE="text/css" TITLE="appropriate style description" MEDIA=screen><LINK REL="Alternate Stylesheet" HREF="style4.css" TYPE="text/css" TITLE="appropriate style description" MEDIA=print>

Alternate stylesheet are not yet supported.

Page 10: IT 2353 Unit II 2Marks

18.How do I place text over an image?

To place text or image over an image you use the position property. The below exemple is supported by IE 4.0. All you have to do is adapt the units to your need.

<div style="position: relative; width: 200px; height: 100px"><div style="position: absolute; top: 0; left: 0; width: 200px"><image></div><div style="position: absolute; top: 20%; left: 20%; width: 200px">Text that nicely wraps</div></div>

19.What is the difference between ID and CLASS?

ID identifies and sets style to one and only one occurrence of an element while class can be attached to any number of elements. By singling out one occurrence of an element the unique value can be declared to said element.

CSS#eva1 {background: red; color: white}.eva2 {background: red; color: white}

HTML - ID<P ID=eva1>Paragraph 1 - ONLY THIS occurrence of the element P (or single occurrence of some other element) can be identified as eva1</P><P ID=eva1>Paragraph 2 - This occurrence of the element P CANNOT be identified as eva1</P>

HTML - CLASS<P class=eva2>Paragraph 1 - This occurrence of the element P can be classified as eva2</P><P class=eva2>Paragraph 2 - And so can this, as well as occurrences of any other element, </P>

Page 11: IT 2353 Unit II 2Marks

20.How does inheritance work?

HTML documents are structured hierarchically. There is an ancestor, the top level element, the HTML element, from which all other elements (children) are descended. As in any other family also children of the HTML family can inherit their parents, e.g. color or size. By letting the children inherit their parents a default style can be created for top level elements and their children. (Note: not all properties can be inherited). The inheritance starts at the oldest ancestor and is passed on to its children and then their children and the children's children and so on.

Inherited style can be overridden by declaring specific style to child element. For example if the EM element is not to inherit its parent P then own style must be declared to it. For example:

BODY {font-size: 10pt}All text will be displayed in a 10 point font

BODY {font-size: 10pt}H1 {font-size: 14pt} or H1 {font-size: 180%}

All text except for the level 1 headings will be displayed in a 10 point font. H1 will be displayed in a 14 point font (or in a font that is 80% larger than the one set to BODY). If the element H1 contains other elements, e.g. EM then the EM element will also be displayed in a 14 point font (or 180%) it will inherit the property of the parent H1. If the EM element is to be displayed in some other font then own font properties must be declared to it, e.g.:

BODY {font-size: 10pt}H1 {font-size: 14pt} or H1 {font-size: 180%}EM {font-size: 15pt} or EM {font-size: 110%}

The EM element will be displayed in a 15 point font or will be 10% larger than H1. NOTE: EM is, in this example, inside H1 therefore will inherit H1's properties and not Body's.

The above declaration will display all EM elements in 15 point font or font that is 10% larger than font declared to the parent element. If this specific font is to apply to EM elements but only if they are inside H1 and not every occurrence of

Page 12: IT 2353 Unit II 2Marks

EM then EM must take a form of a contextual selector.

H1 EM {font-size: 15pt} or H1 EM {font-size: 110%}

In the example above EM is a contextual selector. It will be displayed in specified font only if it will be found in the context of H1.

Not all properties are inherited. One such property is background. However, since it's initial value is transparent the background of the parent element will shine through by default unless it is explicitly set.

21.What is JavaScript?

JavaScript is a general-purpose programming language designed to let programmers of all skill levels control the behavior of software objects.

The language is used most widely today in Web browsers whose software objects tend to represent a variety of HTML elements in a document and the document itself.

But the language can be--and is--used with other kinds of objects in other environments. For example, Adobe Acrobat Forms uses JavaScript as its underlying scripting language to glue together objects that are unique to the forms generated by Adobe Acrobat. Therefore, it is important to distinguish JavaScript, the language, from the objects it can communicate with in any particular environment.

When used for Web documents, the scripts go directly inside the HTML documents and are downloaded to the browser with the rest of the HTML tags and content.

JavaScript is a platform-independent,event-driven, interpreted client-side scripting and programming language developed by Netscape Communications Corp. and Sun Microsystems.

22.What are JavaScript types?

Number, String, Boolean, Function, Object, Null, Undefined.

Page 13: IT 2353 Unit II 2Marks

23.How to create arrays in JavaScript?

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);

24.Methods GET and POST in HTML forms - what's the difference?

GET: Parameters are passed in the querystring. Maximum amount of data that can be sent via the GET method is limited to about 2kb.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.

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

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

26.How to determine the state of a checkbox using Javascript?

Page 14: IT 2353 Unit II 2Marks

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

27.How to set the focus in an element using Javascript?

<script> function setFocus() { if(focusElement != null) { document.forms[0].elements["myelementname"].focus(); } } </script>

28.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 the external javscript file to be accessed

29.What looping structures are there in JavaScript?

for, while, do-while loops, but no foreach.

30.How to put a "close window" link on a page ?

<a href='javascript:window.close()' class='mainnav'> Close </a>

31.How to hide javascript code from old browsers that dont run it?

Use the below specified style of comments <script language=javascript> <!-- javascript code goes here // --> or Use the <NOSCRIPT>some html code </NOSCRIPT>

Page 15: IT 2353 Unit II 2Marks

tags and code the display html statements between these and this will appear on the page if the browser does not support javascript

32.How to comment javascript code?

Use // for line comments and/*

*/ for block comments

33.Name the numeric constants representing max,min values

Number.MAX_VALUE Number.MIN_VALUE

34.How do you create a new object in JavaScript?

var obj = new Object(); or var obj = {};

35.How do you assign object properties?

obj["age"] = 17 or obj.age = 17.

36.How to create a popup warning box

alert('Warning: Please enter an integer between 0 and 100.');

Page 16: IT 2353 Unit II 2Marks

37.How to create a confirmation box?

confirm("Do you really want to launch the missile?"); 

38.How to create an input box?

prompt("What is your temperature?");

39.What's Math Constants and Functions using JavaScript?

The Math object contains useful constants such as Math.PI, Math.E Math also has a zillion helpful functions. Math.abs(value); //absolute value Math.max(value1, value2); //find the largest Math.random() //generate a decimal number between 0 and 1 Math.floor(Math.random()*101) //generate a decimal number between 0 and 100

40.What's the Date object using JavaScript?

Time inside a date object is stored as milliseconds since Jan 1, 1970. new Date(06,01,02) // produces "Fri Feb 02 1906 00:00:00 GMT-0600 (Central Standard Time)" new Date(06,01,02).toLocaleString() // produces "Friday, February 02, 1906 00:00:00" new Date(06,01,02) - new Date(06,01,01) // produces "86400000"

41.What does the delete operator do?

The delete operator is used to delete all the variables and objects used in the program ,but it does not delete variables declared with var keyword.

Page 17: IT 2353 Unit II 2Marks

42.What does break and continue statements do?

Continue statement continues the current loop (if label not specified) in a new iteration whereas break statement exits the current loop.

43.How to create a function using function constructor?

The following example illustrates thisIt creates a function called square with argument x and returns x multiplied by itself.var square = new Function ("x","return x*x");

44.What is Style Property Inheritance in CSS?

Style property Inheritance is a rule that allows a style property of a child HTML tag to inherit the same property of the parent HTML tag, if that property is not defined on the child tag. This inheritance rule is very important because a lots of style properties are defined on the parent tags and inherited to the child tags. The CSS below shows you how to define most of the font properties on <P> tags and let <STRONG> and <EM> to inherit them:

<html><head><title>CSS Included</title><style type="text/css">BODY {background-color: black}P {font-family: arial; font-size: 12pt; color: yellow}STRONG {font-weight: bold}EM {font-style: italic}</style></head><body><p>Welcome to <strong>GlobalGuideLine.com</strong>. You should see this text in <em>yellow</em> on black background.</p></body></html>

Page 18: IT 2353 Unit II 2Marks

As you can, the font family, size and color in <STRONG> and <EM> are inherited from <P>.

45. Mention the advantages of java/java script?

Use sending data continuously File storage Massively parallel computing

Smart forms – includes various controls like text box, radio button, textc. area control etc.

Peer-to-Peer Interaction – used in various client/server model.

Games – Combine the ability to easily include networking in your programs with java’s powerful graphics and you have the recipe for truly awesome multiplayer games.

Chat – Used in various chat applications.

Whiteboards – Java programs are not limited to sending ext and datag. across the network.

A number of programmers have developed whiteboard software that allows users in diverse locations to draw on their computers

 

46. List down the ways of including style information in a document?

Linked Styles -Style information is read from a separate file that is specified in the <LINK> tag

Embedded Styles -Style information is defined in the document head using the <STYLE> and </STYLE> tags.

Inline Styles -Style information is placed inside an HTML tag and applies to all content between that tag and it companion closing tag.

 

47. Define cascading?

Cascading refers to a certain set of rules that browsers use, in cascading order, to determine how to use the style information. Such a set of rules is useful in the event of conflicting style information because the rules would give the browser a way to determine which style is given precedence.

Page 19: IT 2353 Unit II 2Marks

 

48. What are the style precedence rules when using multiple approaches?

Inline styles override both linked style sheets and style information stored in the document head with <STYLE> tag.

Styles defined in the document head override linked style sheets.

Linked style sheets override browser defaults.

 

49. Give the syntax to specify a characteristic in linked style sheet?

{Characteristic: value}

Multiple characteristic/value pairs should be separated by semicolons.

50.. List down font characteristics permitted in style sheets?

font-family font-size

font-weight

font-style

font-variant

 

51.Write a note on content positioning characteristic \"Visibility\"?

Enables the document author to selectively display or conceal positioned content; Possible values are show or hide.

 

52.Define scriptlets?

Scriptlets enable you to create small, reusable web applications that can be used in any web page. Scriptlets are created using HTML, scripting and Dynamic HTML. To include them in an HTML document use the <OBJECT> tag.

Page 20: IT 2353 Unit II 2Marks

 

53. What does DHTML refer?

DHTML refers to collection of technologies, which makes HTML documents more dynamic and interactive.

 

54. What does data binding mean?

Data binding is DHTML feature that lets you easily bind individual elements in your document to data from another source such as database or comma delimited text file.

 

55. What is meant by Plug-in?

A hardware or software module that adds a specific feature or service to a larger system. The idea is that the new component simply plugs in to the existing system. For example, there are number of plug-ins for the Netscape Navigator browser that enable it todisplay different types of audio or video messages. Navigator plug-ins are based on MIME filetypes.

 

56.Mention the types of scripting language?

JavaScript is a Scripting language (web site development environment) created by Netscape

Hence JavaScript works best with the Netscape suite of Client and Server products.

JavaScript is the native scripting language of Netscape Navigator.

VBScript is the native Scripting language of HTML.

56. what is server side scripting?

In Server side scripting the script program is executed at Server Side the required html program is sent to the client.

Page 21: IT 2353 Unit II 2Marks

The job of the server is more in server side scripting

57.what is client side scripting?

Here the script program is processed and executed in the client side itself. So that it reduces the burden of the server.

 

58.List the advantages of javascript?

JavaScript is an object-oriented language that allows creation of interactive Web pages

JavaScript allows user entries, which are loaded into an HTML form to be processed as required

  Advantages

It is an interpreted language, which requires no compilation steps. Embedded within HTML.

Minimal Syntax – easy to learn

Quick Development

Designed for simple, small programs

High performance

Procedural Capabilities – support facilities such as condition checking, looping and branching.

Designed for programming user events – like VB Java Script is also based on Events.

Easy Debugging and Testing

Platform Independence/ Architecture Neutral

59.write the syntax of javascript program?

<HTML>

Page 22: IT 2353 Unit II 2Marks

<HEAD>

<SCRIPT language = “JavaScript”>

. … body of the script program

</SCRIPT>

</HEAD>

<BODY>

<SCRIPT language = “JavaScript”>

body of the program.

</SCRIPT>

</BODY>

</HTML>

60.What is Dense arrays?

A dense array is an array that has been created with each of its elements being assigned a specific value

Dense arrays are used exactly in the same manner as other arrays.

Dense arrays are declared and initialized at the same time.

 Array Methods

Join() – returns all elements of the array joined together as a single string. Reverse() – reverses the order of the elements in the array.

61.list comparison operator and string operator in java?

Comparison operators

= = equal (perform type conversion before testing for equality.

Page 23: IT 2353 Unit II 2Marks

= = = strictly equal (do not perform type conversion before testing for equality

String operators

Currently Java Script supports only one string concatenation (+) operator.

Example

“ab” + “cd” produces “abcd”

62.List the various dialog boxes in javascript?

Dialog boxes are used to display small windows. This is also used to get input from user.

 SYNTAX

alert(“message”) alert(“Click here to continue”)

prompt(“Enter your name”, name)

Alert is only used to display some information

Prompt is used to display information along with some input value

Confirm dialog box, causes program execution to halt until user action takes place.

The user action can be either OK or CANCEL.

OK – returns true

CANCEL – returns false

 

 63.Mention various javascript object models?

Math Object String Object

Date Object

Page 24: IT 2353 Unit II 2Marks

Boolean and Number Object

Document Object

Window Object

 

64.How scripting language differs from HTML?

HTML is used for simple web page design HTML with FORM is used for both form design and Reading input values from

user.

Scripting Language is used for Validating the given input values weather it is correct or not, if the input value is incorrect, the user can pass an error message to the user.

Using form concept various controls like Text box, Radio Button, Command Button, Text Area control and List box can be created.

 

65.Define function in javascript?

Function is a part of a program or in other words function is a module in java program which can be called or invoked any number of times from the main program.

Function can be called any number of times but it can accept any input values or parameters, however it can return only one output at a time.

 

66.Mention the types of stylesheet?

Embedded or Internal Style sheet External or Linked Style sheet

Inline style sheet

 

Page 25: IT 2353 Unit II 2Marks

67.List the difference between various stylesheets?

Embedded style sheet  

Style program is embedded with in theHTML program itself. Explicit LINK statement is not needed. Styles can be used within the program only, it cannot be called some other files.

External Style sheet

Style program alone is stored in a separate file with an extension of .css file. Explicit LINK REL statement is needed to connect with .CSS file. Styles used in .CSS file can be used in any HTML program file.

68.List the properties of style tag?

<STYLE> tag properties are divided in to 6 categories. They are

Font Attributes Color and Background attributes

Text Attributes

Border Attributes

Margin Attributes and

List Attributes.

 69.How to introduce style in HTML program?

<HTML>

<HEAD>

<STYLE Type = “text/css”>

predefined tag name {attribute name1:attribute value1; attribute name2:attribute

value2; ……attribute name-n:attribute value-n}

<STYLE>

</HEAD>

Page 26: IT 2353 Unit II 2Marks

<BODY>

write the body of program

</BODY> </HTML>

 

 70. List out the differences between Java script & VB script.

71. What is the advantage of client side programming?

72. List out the various client side programming languages.

73.What are the uses of Java script?

74.What are the various browsers to be supported .

75. Write a java script program to print first 100 numbers .

76. Write a java script program to print Armstrong numbers between 1 to 500.

77. Draw the DOM model.

 

PART B

 

1. Explain the document object model architecture

2. Explain the various event handlers in java script. Give an example.

3. Write a java script program to develop the arithmetic calculator

4. Write a java script program to perform the validation process in an application programs

Page 27: IT 2353 Unit II 2Marks

5. Write short notes on scripting languages.

6. What are the various java script objects? Explain each with an example.

7. How to validate the check box and check box group?

8. Explain about types of cascading style sheet? Explain with example

9. Explain the various CSS properties

10. What is html? explain the various html tags to develop the web pages.

11. What is the use of HTML Forms? Create a HTML Form page for Railway Registration Form

12. What is CSS ? List out the Various CSS Properties. Explain the various concepts of CSS properties with neat example.

13. What are the types of CSS? Explain any two with neat example.

14. Explain Dhtml.

15. Explain how Dhtml used to develop the web pages.

16. With a neat diagram write a SCRIPT PROGRAM with validation for the following (each program carries 16 marks)

• Student Mark List

• Inventory System

• Employee Pay Slip generation

• Railway Ticket Reservation

• Online Quiz program

 

17. Draw form design

• Design must have one Primary key field – always

• check for duplication for the primary key field

Page 28: IT 2353 Unit II 2Marks

• emp- name, product- name, dept-name etc should not be blank

• Write a function for all these validation

• When you introduce any number field, always check it is negative or not, if it so do not accept the input value

• For calculations always use program concept, do not ask the user to enter total, gross etc.

• Instead through program calculate Gross.value = val(basic.value + hra.value+da.value)

• Always use val or ParseInt function when you perform calculation with numbers.

• for avoiding too much of validation better use the following in the design itself

• Radio button

• Command button

• Check box

• List box

• Must introduce SUBMIT & RESET button at the end of the design

 

18. Explain in detail about all the types of Cascading Style sheet with an example Program draw the form design

19. Mention the 3 types of CSS

20. Write example program for each type of CSS

21. Write the differences and advantages of each CSS

22. Write short notes on the following

23. Write short notes on Java Script/Advantages of Scripting

• Java Script control statements

• Java Script functions

Page 29: IT 2353 Unit II 2Marks

24. Discuss briefly about HTML – Object Model and Collections

• Object modeling

• Object Referencing

• Dynamic Styles

• Dynamic Positioning

25. Discuss briefly Dynamic HTML – Event Model

26. Write Short notes on event model

27. Explain Event bubbling with an example program

28. How can we JavaScript using Objects. Give an Example

29. With an example describe java scripts Control structure.

30. Explain about CSS.

31. With an example describe java scripts Control structure

32. What are Style Sheets? List down the ways of including style information in a document. Explain about types of cascading style sheet? Explain with example.

33. What are the methods associated with array object in JavaScript? Explain each one with an example.

34. Write a JavaScript to display a welcome button of an html form is pressed

35. What do you mean by CSS? Discuss the properties of CSS-level-1 in detail with suitable example.

36. Write a JavaScript program to demonstrate the JavaScript events.

37. Design a webpage with a textbox where the user can enter a four digit number and a button “validate” . Validate the entered number for the following using java script. No zero as the first digit Entered number must be in ascending order of digits (Ex:1234,5678…)

 

Page 30: IT 2353 Unit II 2Marks

38. Write the complete JavaScript to prompt the user for the radius of the sphere and call function sphere Volume to calculate and display the volume of the sphere. Use the statement. Volume=(4.0/3.0)*Math.PI*Math.pow(radius,3)

39. To calculate the volume, the user should input the radius through an HTML text field and press an HTML button to initiate the calculations.

40. What are the objectives of using Cascading style sheet? Briefly explain about linking of external Style sheets and fixing the backgrounds.

41. Explain the concept of CSS and its properties and its uses with an example.

42. Using a JavaScript create a web page using two image files , which switch between one another as the mouse pointer moves over the images.

43. Write JavaScript for the following. Provide a text box for the user enter user name. validate the username for the no. of characters(assume some no. say 6). Provide a SUBMIT button for the validation to happen. On successful validation display a new page with an image and two text boxes for entering the width and height of the image respectively with a RESIZE button below. On clicking the Resize button validate the width and height numbers and on successful validation display the image with the requested width and height.

44. Develop a simple online shopping application using JavaScript(Assume your own data)

45. What are Style Sheets? List down the ways of including style information in a document. Explain about types of cascading style sheet? Explain with example.

 

46. What is CSS ? List out the Various CSS Properties. Explain the various concepts of CSS properties with neat example.

47. Explain the various event handlers in java script. Give an example of each. Write a java script program to develop the arithmetic calculator .

48. develop the web page for employee management system and validate all the fields using java script. (Note: The web page should contain all the html forms control)

 

49. Explain about cascading style sheets in detail.

Page 31: IT 2353 Unit II 2Marks

i. Style sheet rules

ii. Styling a page

iii. Linking style sheets

iv. Inline style sheets.

50. Write a XHTML program to create a web page for your college information using any one CSS type (Assume your own data) .Explain the various CSS properties in detail. Write a suitable code each property.

 

51. Develop a JavaScript program to display a message “HI ! GOOD MORNING TO YOU” when a page is loaded and display a message “THANKS TO VISIT OUR WEB PAGE” when a page is unloaded.

52. Design a web page with a text box (username) where the user can enter a name and another text box (ID) where the user enter an only four digit ID.NO and a button “validate”. Validate the entered username and ID field for the following using java script.

i. Both the fields should not be empty

ii. Name field should have alphabets

iii. ID field should have numeric.