Sie sind auf Seite 1von 17

Explain the Structure of an Internet Address:-

Each web page, as any document stored in Internet, has its unique address. This
address is called URL - Universal Resource Locator. URL consists of characters
and the resource is searched according this character string.

An Internet address can be composed from four components:


 Protocol
 Server Name
 Folder
 Document

Protocol
A protocol indicates which one of the Internet browser conventions should be
used for access to Internet. Basic protocols are:

 http - used for browsing www pages


 https - used for browsing www pages with secure access (data, sent to the
server are coded and therefore protected against misuse by unauthorized
person)
 ftp - used for access to FTP servers (file transmission),
 file - used for access to local files

Server name
This part of an Internet address specifies a physical computer storing web pages
or other documents. URL usually starts with www.
Folder
Documents at a web server are stored in folders having the same properties as
folders of your computer.
Document
Internet documents are called HTML documents. Their common extensions are:
.htm, .html, but also others, e.g. .php, .asp, .nsf, etc.

What is Internet Protocol? Explain in brief.

IP (Internet Protocol) is the primary network protocol used on the Internet,


developed in the 1970s. On the Internet and many other networks, IP is often
used together with the Transport Control Protocol (TCP) and referred to
interchangeably as TCP/IP.

IP supports unique addressing for computers on a network. Most networks use


the Internet Protocol version 4 (IPv4) standard that features IP addresses four
bytes (32 bits) in length. The newer Internet Protocol version 6 (IPv6) standard
features addresses 16 bytes (128 bits) in length.

Data on an Internet Protocol network is organized into packets. Each IP packet


includes both a header (that specifies source, destination, and other information
about the data) and the message data itself.

IP functions at layer 3 of the OSI model. It can therefore run on top of different
data link interfaces including Ethernet and Wi-Fi.

Explain in Detail about FTP:

FTP (Also Known As: File Transfer Protocol) allows you to transfer files
between two computers on the Internet. FTP is a simple network protocol based
on Internet Protocol and also a term used when referring to the process of
copying files when using FTP technology.
To transfer files with FTP, you use a program often called the client. An FTP
client program initiates a connection to a remote computer running FTP server
software. After the connection is established, the client can choose to send
and/or receive copies of files, singly or in groups. To connect to an FTP server,
a client requires a username and password as set by the administrator of the
server. Many public FTP archives follow a special convention for that accepts a
username of "anonymous."

Simple FTP clients are included with most network operating systems, but most
of these clients (such as FTP.EXE on Windows) support a relatively unfriendly
command-line interface. Many alternative third-party FTP clients have been
developed that support graphic user interfaces (GUIs) and additional
convenience features. In any FTP interface, clients identify the FTP server
either by its IP address (such as 192.168.0.1) or by its host name (such as
ftp.about.com).

FTP supports two modes of data transfer: plain text (ASCII), and binary. You
set the mode in the FTP client. A common error when using FTP is attempting
to transfer a binary file (such as a program or music file) while in text mode,
causing the transferred file to be unusable.

Explain Overview of TCP/IP:

Applications developed for TCP/IP generally use several of the protocols in the
suite. The layers of the protocol suite is also known as the protocol stack. User
applications communicate with the top layer of the protocol suite. The top-level
protocol layer on the source computer passes information to the lower layers of
the stack, which in turn pass it to the physical network. The physical network
transfers the information to the destination computer. The lower layers of the
protocol stack on the destination computer pass the information to higher layers,
which in turn pass it to the destination application.

Each protocol layer within the TCP/IP suite has various functions; these
functions are independent of the other layers. Each layer, however, expects to
receive specific services from the layer beneath it, and each layer provides
specific services to the layer above it.

Figure shows the TCP/IP protocol layers. The layers at the same level on the
source and destination computers are peers. For example, the application on the
source computer and the application on the destination computer are peers. Each
layer of the protocol stack on the source computer communicates with its peer
layer on the destination computer. From the perspective of the software
developer or user, the transfer takes place as if the peer layers sent their packets
directly to one another.
There are four Layers are there in TCP/IP:
 Link Layer
 Internet Layer
 Transport Layer
 Application Layer

Link Layer:
The link layer is used to move packets between the Internet layer interfaces of
two different hosts on the same link. The TCP/IP model includes specifications
of translating the network addressing methods used in the Internet Protocol to
data link addressing, such as Media Access Control (MAC). All other aspects
below that level, however, are implicitly assumed to exist in the link layer, but
are not explicitly defined.

Internet Layer:
The internet layer has the responsibility of sending packets across potentially
multiple networks. Internetworking requires sending data from the source
network to the destination network. This process is called routing.[19]

In the Internet protocol suite, the Internet Protocol performs two basic
functions:

 Host addressing and identification: This is accomplished with a


hierarchical IP addressing system.
 Packet routing: This is the basic task of sending packets of data
(datagrams) from source to destination by forwarding them to the next
network router closer to the final destination.
Transport Layer:
The transport layer establishes a basic data channel that an application uses in
its task-specific data exchange. The layer establishes process-to-process
connectivity, meaning it provides end-to-end services that are independent of
the structure of user data and the logistics of exchanging information for any
particular specific purpose. Its responsibility includes end-to-end message
transfer independent of the underlying network, along with error control,
segmentation, flow control, congestion control, and application addressing (port
numbers).

Application Layer:
The application layer includes the protocols used by most applications for
providing user services or exchanging application data over the network
connections established by the lower level protocols, but this may include some
basic network support services, such as many routing protocols, and host
configuration protocols. Examples of application layer protocols include the
Hypertext Transfer Protocol (HTTP), the File Transfer Protocol (FTP), the
Simple Mail Transfer Protocol (SMTP), and the Dynamic Host Configuration
Protocol (DHCP).[20] Data coded according to application layer protocols are
encapsulated into transport layer protocol units (such as TCP or UDP
messages), which in turn use lower layer protocols to effect actual data transfer.

Structure of HTML Program:

A HTML document is basically separated in two parts: the head (HTML head
tag) and the body (HTML body tag). We also add a Document type declaration
on top of it to get the basic document structure and HTML version. The
structure of a HTML document is shown below.
Structure:
<! DOCTYPE …> version information
<HTML>
<HEAD>
...information about document, scripts, styles….
</HEAD>
<BODY>
...visible content of document….
</BODY>
</HTML>

The !DOCTYPE declaration:


Every well written HTML document begins with a basic declaration that defines
what type of document it is. This declaration is made using the !DOCTYPE tag
and is to be written at the beginning of the document. It tells the processing
agent and HTML version.

<HTML> tag:
The html tag acts as a container for the whole document. Every character in the
document should be in between the html start and end tags. The html tag can
also be used to define the language of the contained document through the
"lang" attribute. The content of the html tag is divided in two parts using the
head (HTML head tag) and the body (HTML body tag).

<HEAD> tag:
This section is the document's head. All the information contained in the
document's head is loaded first, before any other thing in the document, as it's
defined before the body segment. It includes tags like title, script, style, meta
and so on.
<BODY> tag:
This is the document's body: The body is the container for the visual part of a
document. All the things written here will be shown when the document is
rendered. Most of the tags in HTML can be inserted in the body section (inside
the HTML body tag) and will take care of the visual aspects of the document.

Example:
<HTML>
<HEAD>
<TITLE> My first Page </TITLE>
</HEAD>
<BODY>
<H1> Hello HTML <H1>
</BODY>
</HTML>

List:
There are Three types of List in HTML:
 Ordered List
 Unordered List
 Definition List or Description List

Ordered Lists
Use the <ol> tag (the ending </ol> tag is required), to create a numbered list
with numbers starting at 1. The elements are created with the <li> tag (the
ending </li> tag is not required in HTML, but required in XHTML).
For Example:
<ol>
<li>Entry 1</li>
<li>Entry 2</li>
<li>Entry 3</li>
</ol>

Unordered Lists
Use the <ul> tag (the ending </ul> tag is required) to create a list with bullets
instead of numbers. Just like with the ordered list, the elements are created with
the <li> tag. For example:

<ul>
<li>Entry 1</li>
<li>Entry 2</li>
<li>Entry 3</li>
</ul>

Definition Lists
Definition lists create a list with two parts to each entry: the name or term to be
defined and the definition. This creates lists similar to a dictionary or glossary.
There are three tags associated with the definition list:

 <dl> to define the list


 <dt> to define the definition term
 <dd> to define the definition of the term

HTML does not require the closing tag for the <dt> or the <dd>, but it's a good
idea to use them so other parts of your design aren't confused. And the ending
tags are required in XHTML.
Here is how a definition list looks:

<dl>
<dt>This is a definition term</dt>
<dd>And this is the definition</dd>
<dt>term 2</dt>
<dd>definition 2</dd>
<dt>term 3</dt>
<dd>definition 3</dd>
</dl>

Explain Text Formatting:


These are the text formatting tags that are available in HTML
Tag Description
<b> Defines bold text
<em> Defines emphasized text
<i> Defines a part of text in an alternate voice or mood
<small> Defines smaller text
<strong> Defines important text
<sub> Defines subscripted text
<sup> Defines superscripted text
<ins> Defines inserted text
<del> Defines deleted text
<mark> Defines marked/highlighted text
What is Font Attributes? Explain.
These are the Font Attributes that are available in HTML/CSS
Property/Value Description
Specifies the font style. Default value is "normal". See font-
font-style
style for possible values
Specifies the font variant. Default value is "normal". See font-
font-variant
variant for possible values
Specifies the font weight. Default value is "normal". See font-
font-weight
weight for possible values
font-size/line- Specifies the font size and the line-height. Default value is
height "normal". See font-size and line-height for possible values
Specifies the font family. Default value depends on the
font-family
browser. See font-family for possible values
Uses the font that are used by captioned controls (like buttons,
caption
drop-downs, etc.)
icon Uses the font that are used by icon labels
menu Uses the fonts that are used by dropdown menus
message-box Uses the fonts that are used by dialog boxes
small-caption A smaller version of the caption font
status-bar Uses the fonts that are used by the status bar
initial Sets this property to its default value. Read about initial
Inherits this property from its parent element. Read about
inherit
inherit
Explain border-width Property.
CSS Syntac : border-width: medium|thin|thick|length|initial|inherit;
Value Description
medium Specifies a medium border. This is default
thin Specifies a thin border
thick Specifies a thick border
length Allows you to define the thickness of the border
initial Sets this property to its default value.
inherit Inherits this property from its parent element. Read about inherit

Simple javaScript Program to add 2 numbers:


<html>
<body>
<p>Click the button to calculate x.</p>
<button onclick="myFunction()">Try it</button>
<br/>
<br/>Enter first number:
<input type="text" id="txt1" name="text1">Enter second number:
<input type="text" id="txt2" name="text2">
<p id="demo"></p>
<script>
function myFunction() {
var x = parseInt(stringValueX, 10);
var y = parseInt(stringValueY, 10);
var z = x + y;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>
Discuss the built in objects in JavaScript?
Object is the main data type in JavaScript. "Everything" in JavaScript is an
Object.
Even primitive data types (except null and undefined) can be treated as objects.
 Booleans can be objects (or primitive data treated as objects)
 Numbers can be objects (or primitive data treated as objects)
 Strings are also objects (or primitive data treated as objects)
 Dates are always objects
 Maths and Regular Expressions are always objects
 Arrays are always objects
 Even functions are always objects

Creating JavaScript Object:


With JavaScript, you can define and create your own objects. There are
different ways to create new objects:

 Define and create a single object, using an object literal.


 Define and create a single object, with the keyword new.
 Define an object constructor, and then create objects of the constructed
type.
How a browser Communicates with a Server? Explain.
What is functions in JavaScript? Discuss the Function with parameters and
return value?

A function is a group of reusable code which can be called anywhere in your


programme. This eliminates the need of writing same code again and again.
This will help programmers to write modular code. You can divide your big
programme in a number of small and manageable functions.

Like any other advance programming language, JavaScript also supports all the
features necessary to write modular code using functions.

Function Definition:
Before we use a function we need to define that function. The most common
way to define a function in JavaScript is by using the function keyword,
followed by a unique function name, a list of parameters (that might be empty),
and a statement block surrounded by curly braces. The basic syntax is shown
here:
Syntax: Example
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
function functionname(parameter-list) function sayHello()
{ {
Statements alert(“Hello there”);
} }
//--> //
</script> </script>

Calling a Function:
To invoke a function somewhere later in the script, you would simple need to
write the name of that function as follows:
<script type="text/javascript">
<!--
sayHello();
//-->
</script>
Function Parameters:
Till now we have seen function without a parameters. But there is a facility to
pass different parameters while calling a function. These passed parameters can
be captured inside the function and any manipulation can be done over those
parameters. A function can take multiple parameters separated by comma.

Example:
<script type="text/javascript">
<!--
function sayHello(name, age)
{
alert( name + " is " + age + " years old.");
}
//-->
</script>

Note: We are using + operator to concatenate string and number all together. JavaScript does
not mind in adding numbers into strings. Now we can call this function as follows:

<script type="text/javascript">
<!--
sayHello('Zara', 7 );
//-->
</script>

The return Statement:


A JavaScript function can have an optional return statement. This is required if
you want to return a value from a function. This statement should be the last
statement in a function.

For example you can pass two numbers in a function and then you can expect
from the function to return their multiplication in your calling program.

Example:
<script type="text/javascript">
<!--
function concatenate(first, last)
{
var full;

full = first + last;


return full;
}
//-->
</script>

Now we can call this function as follows:


<script type="text/javascript">
<!--
var result;
result = concatenate('Zara', 'Ali');
alert(result );
//-->
</script>

Das könnte Ihnen auch gefallen