Beruflich Dokumente
Kultur Dokumente
Unit -1
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Objective
Overview of Internet and web HTML Tags, Forms & Frames Introduction to Java Script and Cascading Style Sheets DHTML Using various Web Design Tools like Dream Weaver
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Web Browser
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
the rules for transferring information between programs HTTP - hypertext transfer protocol FTP - file transfer protocol SMTP simple mail transfer protocol
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Internet
connection
Internet Their computer, Routers Their web server (an HTTP server) e.g. Apache
/mypage.ht ml
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
HTML is a mark-up language You add the mark-up tags to your text document HTML is a language of mark-up tags in angle brackets: <>
each tag has a name and may have one or more quoted attributes eg. <p class=thesis style=color: red>
Tags usually come in pairs (with some exceptions) <html>...</html>, <body>...</body>, <p>...</p>, <hr>, <br> Web pages are free-form input; line breaks can be used most anywhere and don't affect the appearance of the document Yes, your entire page could be a single line of text!
U2.#
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
This figure shows a form that contains various control elements commonly used in Web page forms. drop-down
list box
City
Country Item Purchased
State
Zip
group box
Used For (check one) Home Business Religious or Charitable Institution Government Educational Institution
Network Operating System (check all that apply) Netware Banyan Vines Windows IBM Lan Server PC/NFS
radio buttons
Comments?:
form button
Send Registration
Cancel
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
9
U2.#
Basic tag to identify portion of file that contains HTML <html> is an opening tag </html> is a closing tag (note the direction of the slash!) text between the opening and closing tag is called the element
placed at the top of document immediately after the <html> tag tags information about the document, e.g. author, style, etc. contains the required document <title>...</title> tag
U2.#
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
included as an element inside the <head></head> section element of this tag is the title displayed in title bar of the browser may also be used as title of page when page is bookmarked should be meaningful and uniquely identify the page included as the second element inside the <html></html> tags. follows the <head></head> portion of the document contains the information to be displayed in the browser window any attributes set on this tag will apply to the entire page
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
DOCTYPE (Required!)
Must be the very first line of your file, before <html> NOT an HTML tag; it is an instruction to your web browser Tells the browser what version of HTML to expect In this course we use only the strict HTML version 4.01 type:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
That's all you need for a basic web page! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>My Title</title> </head> <body> <p>This is my first web page.</p> </body> </html>
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
<br>
Comment Tag
notice that the comment is typed as an attribute inside the tag comments may be one or multiple lines long (HTML is free-form) text within this tag will not be displayed or processed by your browser comments do not nest! No comments inside comments! The comment may not contain two (or more) adjacent dashes, e.g. --
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
<a> </a>
one major attribute the location of the hyperlink: href=string element is clickable/selectable as a document hyperlink browser attempts to load the page specified by the href= attribute the href= string can be a relative URL on the same server: without the leading http://host/ it is in the same directory structure: e.g. <a href=page2.html>Click here to continue</a> e.g. <a href=images/box.jpg>See the box here.</a> e.g. <a href=../another_dir/page3.html>Click here</a>
U2.#
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
<blockquote> </blockquote>
<q> </q>
<pre> </pre>
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
The <style> element: <style type=text/css> ... </style> <style> tag always goes in the <head> section defines style information for the whole HTML page requires the type=text/css attribute
more details to come in the description of CSS to link to a separate CSS style sheet, use instead:
U2.#
HTML - Lists
Lists <ul> Unordered List and <ol> Ordered List
<ul> <li>Apple</li> <li>Pear</li> <li>Kiwi</li> <li><ul> <li>Big</li> <li>Small</li> </ul></li> </ul> <ol> <li>Apple</li> <li>Pear</li> <li>Kiwi</li> <li><ul> <li>Big</li> <li>Small</li> </ul></li> </ol>
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
<ul></ul>
surrounds an unordered list no numbering <li>...</li> items each indented and bulleted use styles (style= attribute) to change type of bullet: CSS style: list-style-type: string
string can be: circle, disc, square e.g. <ul style=list-style-type: square> ... </ul>
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
21
U2.#
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
22
U2.#
Tables
Tables permit you to have some control over layout while leaving some decisions to the browser. <table> ... </table> Define rows inside a table
<tr> ... </tr> defines a row
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Tables
Basic table markup <table border="1"> <tr> <td>Row 1, Cell 1</td> <td>Row 1, Cell 2</td> </tr> <tr> <td>Row 2, Cell 1</td> <td>Row 2, Cell 2</td> </tr> Row 1, Cell 1 Row 1, Cell 2 </table>
Row 2, Cell 1 Row 2, Cell 2
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Cell Padding: To provide some margin inside each cell use the cellpadding attribute
<table style="font-family: Arial, Sans-Serif; border:solid 1px" cellspacing="0" cellpadding="5">
28
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Alignment
By default anything in a cell is aligned to the left and vertically centered. To specify alignment use
text-align vertical-align
<tr> <td <td <td <td <td <td <td </tr> style="border:solid style="border:solid style="border:solid style="border:solid style="border:solid style="border:solid style="border:solid 1px; 1px; 1px; 1px; 1px; 1px; 1px; text-align:left">OD</td> text-align:right">+1.25</td> text-align:right">-2.50</td> text-align:right">111</td> text-align:right">14.50</td> text-align:center">BI</td> text-align:right">28.00</td>
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
End of Section
U2.#
Images in HTML
Use the <img> tag to display an image in an HTML page.
.gif, .jpg, .png
alt is text to be displayed if the image file cannot be found or cannot be displayed.
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Bharati Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor EndVidyapeeths of Section
34
U2.#
Sound in HTML
We can add sound to an HTML page very much like we add images.
(Not necessarily a good thing to do!)
Add to image_example.html:
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
35
U2.#
Sound in HTML
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Creating Links
Links allow a user to jump to other places by simply clicking on them. This is the hyper in hypertext! A link can go to another point in the same document or to a completely different page Anywhere in the Internet.
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
HTML Forms
An HTML form is define by <form> </form> tag pair. An action attribute on the <form> tag gives the URL of the application that is to receive and process the forms data. A method attribute specifies how the browser will return the users inputs to the server. Example:
<form method="get" action="http://www.widgets.com/cgi-bin/update">
...
</form>
method=GET says to append the user inputs to the URL action says where to send the inputs.
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
39
U2.#
method="post"
Embeds name/value pairs for inputs in the HTTP Request message. Not visible to the user. OK for larger amounts of data. Either method is OK for the web app on the server.
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
HTML Forms
One or more input elements appear between the <form> and </form>
Text Input Radio Buttons Check Boxes Dropdown Lists Buttons Hidden Inputs
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
41
U2.#
Design a form
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
42
U2.#
Source View
<input checked="checked" type="radio" value="Unspecified" /> Unspecified<br /> name="Gender"
<input type="radio" name="Gender" value="Male" /> Male<br /> <input type="radio" name="Gender" value="Female" /> Female<br /> <br />
<input type="checkbox" name="CSE_Major" value="" /> CSE Dept. Major<br /> <br />
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
43
U2.#
Source View
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>A Form Example</title> </head> <body> <form method="get" action="http://www.csee.usf.edu/~turnerr/form_demo.aspx"> Please Register<br /> <br /> <input name="LastName" type="text" /> <input name="FirstName" type="text" /> <br /> Last Name First Name<br /> <br />
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
44
U2.#
Source View
Classification<br /> <select name="Classification" > <option >Freshman</option> <option >Sophomore</option> <option >Junior</option> <option >Senior</option> <option >Graduate</option> <option selected="selected">Unclassified</option> </select> <br /> <br /> <input type="submit" name="Submit_Button" value="submit" /> <br /> <br /> <input type="hidden" name="Hidden" value="This is a hidden input"/> </form>
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Form Example in IE
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
46
U2.#
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
[example.html] <head> <link rel="stylesheet" type="text/css" href="example.css"> </head> [example.css] p{ color: red; foto-size: 120%; }
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
CSS Syntax
Point of the syntax This syntax has two parts, the selector and the declaration.
Selector: Specifies the target of styling. Declaration: Specifies the property and value. Declaration is contained between {" ... "}. Declaration end with a semicolon. p{ color: red; }
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Selectors
Selectors are specify the target of styling. Selectors may range from simple element names to rich contextual representations. Kind of selector Type selector Class selector ID selector Grouping
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Type selector
A type selector is the name of HTML Tag. [index.html] <p>This is a paragraph</p> <p>This is a paragraph</p> <p>This is a paragraph</p> [style.css] p{ color: red; font-size: 12px; }
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Class selector
Class selector is used for one or more elements. It is described the value of class attribute of HTML document with ".(period)". [index.html] <p class="red">This is a paragraph</p> <p class="blue">This is a paragraph</p> <p class="red">This is a paragraph</p> <p class="blue">This is a paragraph</p> [style.css] p{ font-size: 12px; } .red{ color: red; } .blue{ color: blue; }
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
ID selector
ID selector is used for unique element. It is described the value of ID attribute of HTML document with "#". [index.html] <p class="red">This is a paragraph</p> <p class="blue">This is a paragraph</p> <p class="red" id="small">This is a paragraph</p> [style.css] p{ font-size: 12px; } .red{ color: red; } .blue{ color: blue; } #small{ font-size: 9px; }
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Grouping
A comma-separated list of selectors represents the union of all elements selected by each of the individual selectors in the list. [index.html] <h1>This is a heading</h1> <h2>This is a heading</h2> <h3>This is a heading</h3> <h4>This is a heading</h4> [style.css] h1, h2, h3, h4{ color: red; font-size: 12px; }
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
P { color: black; } P, H1, H2 { color: black; } * { color: black; } P.urgent, .Error { color: black; } #Menu { color: black; } *[title], A[href][title] { color: black; } A[title="home page"] { color: black; } A[title~="foo"] { color: black; } *[lang|="en"] { color: black; } UL LI UL { color: black; } P > STRONG { color: black; } H1 + P { color: black; } A:hover { color: black; } P:first-letter { font-size: 200%; }
/* Element Selector */ /* Grouping Selector */ /* Universal Selector */ /* Class Selector */ /* ID Selector */ /* Attribute Selector */ /* Exact Attribute Selector */ /* Partial Attribute Selector */ /* Particular Attribute Selector */ /* Descendant Selector */ /* Child Selector */ /* Adjacent Sibling Selector */ /* Pseudo-Class Selector */ /* Pseudo-Element Selector */
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
background background-repeat color float font-size height line-height list-style-type padding text-align text-transform visibility word-spacing
background-attachment border cursor font font-style left list-style-image margin position text-decoration top white-space word-wrap
background-color bottom display font-family font-weight letter-spacing list-style-position overflow right text-indent vertical-align width z-index
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Java Script
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
What is JavaScript?
JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting language is a lightweight programming language JavaScript is usually embedded directly into HTML pages JavaScript is an interpreted language (means that scripts execute without preliminary compilation) Everyone can u.se JavaScript without purchasing a license
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
JavaScript = ECMAScript
JavaScript is an implementation of the ECMAScript language standard. ECMA-262 is the official JavaScript standard. JavaScript was invented by Brendan Eich at Netscape (with Navigator 2.0), and has appeared in all browsers since 1996. The official standardization was adopted by the ECMA organization (an industry standardization association) in 1997. The ECMA standard (called ECMAScript-262) was approved as an international ISO (ISO/IEC 16262) standard in 1998. The development is still in progress.
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Programming Constructs
Variables
Named elements that can change value
Data types
Integer, floating-point, Boolean, string
Operators
Assignment, comparison, arithmetic, Boolean, string, special
Control statements
Conditions, loops
Keywords
Reserved words with special meaning
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
JavaScript Variables
Variables are "containers" for storing information.
JavaScript Variables As with algebra, JavaScript variables are used to hold values or expressions. A variable can have a short name, like x, or a more descriptive name, like carname. Rules for JavaScript variable names: Variable names are case sensitive (y and Y are two different variables) Variable names must begin with a letter or the underscore character. Note: Because JavaScript is case-sensitive, variable names are case-sensitive.
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
U2.#
Ex: if else
<script type="text/javascript"> //If the time is less than 10, you will get a "Good morning" greeting. //Otherwise you will get a "Good day" greeting. var d = new Date(); var time = d.getHours(); if (time < 10) { document.write("Good morning!"); } else { document.write("Good day!"); } </script>
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
<script type="text/javascript"> var d = new Date() var time = d.getHours() if (time<10) { document.write("<b>Good morning</b>"); } else if (time>=10 && time<16) { document.write("<b>Good day</b>"); } else { document.write("<b>Hello World!</b>"); } </script>
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Ex: Switch
<script type="text/javascript"> //You will receive a different greeting based //on what day it is. Note that Sunday=0, //Monday=1, Tuesday=2, etc. var d=new Date(); var theDay=d.getDay(); switch (theDay) { case 5: document.write("Finally Friday"); break; case 6: document.write("Super Saturday"); break; case 0: document.write("Sleepy Sunday"); break; default: document.write("I'm looking forward to this weekend!"); } </script>
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
JavaScript Functions
A function will be executed by an event or by a call to the function. To keep the browser from executing a script when the page loads, you can put your script into a function. You may call a function from anywhere within a page (or even from other pages if the function is embedded in an external .js file). Functions can be defined both in the <head> and in the <body> section of a document. However, to assure that a function is read/loaded by the browser before it is called, it could be wise to put functions in the <head> section.
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Ex: Functions
<html> <head> <script type="text/javascript"> function displaymessage() { alert("Hello World!"); } </script> </head> <body> <form> <input type="button" value="Click me!" onclick="displaymessage()" /> </form> </body> </html> <html> <head> <script type="text/javascript"> function product(a,b) { return a*b; } </script> </head> <body> <script type="text/javascript"> document.write(product(4,3)); </script>
</body> </html>
U2.#
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
JavaScript Events
Events are actions that can be detected by javaScript. Every element on a web page has certain events which can trigger a JavaScript. For example, we can use the onClick event of a button element to indicate that a function will run when a user clicks on the button. We define the events in the HTML tags. Examples of events: A mouse click A web page or an image loading Mouse over a hot spot on the web page Selecting an input field in an HTML form Submitting an HTML form A keystroke
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
U2.#
U2.#
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
DHTML
DHTML = Dynamic HTML
It allows you to build rich client interfaces and to modify them dynamically
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
2.A plain page without any styles and Scripts called as HTML. 3.HTML sites will be slow upon client-side technologies.
DHTML
1.It is referred as a dynamic HTML and dynamic in nature. 2.A page with HTML, CSS, DOM and Scripts called as DHTML. 3.DHTML sites will be fast enough upon client-side technologies.
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
DHTML In A Nutshell
DHTML is too rich to cover in an hour
The technologies are way to rich to fully cover in this presentation. This presentation will: 1) Briefly introduce each technology with a quick example 2) Give a high-level overview of how to use each technology 3) Show some more advanced uses for the various technologies and review how each one works 4) Provide resources for further exploration of each technology
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
HTML / XHTML
HTML = HyperText Markup Language
Allows you to define and structure the contents of your document. Latest (last?) version is 4.01.
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
CSS
CSS = Cascading Style Sheets
Allows you to define the styles to apply to your document. Latest version is 2.1.
Very powerful
CSS is much more powerful than HTML design tags
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
CSS Example
<STYLE TYPE="text/css">
BODY { background-color: #CCCCCC; }
DOM
DOM = Document Object Model
Defines a hierarchical model of the document structure through which all document elements may be accessed
Nodes
The W3C DOM defines element of a document is a node of a particular type
Node Types
Common types are: document node, element node, text node, attribute node, comment node, document-type node
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
DHTML Example
Style Switcher
Using JavaScript, this example dynamically "applies" the selected CSS style sheet, changing the design on the fly. - JavaScript interacts with DOM and cookies - Shows ability of CSS to affect design w/o changing HTML
function setActiveStyleSheet(title) { var i, a, main; for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) { a.disabled = true; if(a.getAttribute("title") == title) a.disabled = false; } } }
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Event Attributes
Defines event handlers for events of specific elements
<INPUT TYPE="Button" onClick="alert('Hi there!');" VALUE="Hi"> <IMG SRC="blue.gif" onMouseOver="this.src='red.gif';" onMouseOut="this.src='blue.gif';" >
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
JavaScript
Full, feature-rich language
Supports all standard control mechanisms: conditionals, loops, variables, try/catch/throw, functions, "objects"
Very powerful
Earlier versions were limited. Current version is not.
Questions
How a web page runs on a Client server architecture explain? What are HTML Tags and write the steps of add CSS. What is Java Script? Why it is helpful to add JS code in a web form. What is Cascading Style Sheets. Why it is used and explain the What is DHTML. Explain the role of it.
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#
Resources: Online
W3C Website http://www.w3.org/Style/CSS/ http://www.w3.org/DOM/ http://www.w3.org/MarkUp/
References
Books:
Stephen Walther, ASP.NET 4.0 , Pearson Education, Second Edition, 2004. [Stephen Walther]
Beginning Asp.net web pages with web matrix [Mike Brind] Pro ASP.Net 4 in C# 2010
[Mathew MacDonald ]
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi -63, by Vaibhav Singhal, Asst. Professor
U2.#