INTERNAL ASSIGNMENT
Session:- December 2022
Program:- MCA
Semester:- IV
Course Code & Name:- DCA 8241 & ADAVANCE WEB PROGRAMMNING
Name:- Suman mog chowdhury
UID:- 2114101746
1. List and differentiate the HTML Header and Body elements.
:-
head body
Tag used Tag is used <head> Tag is used <body>
Position First section. Second section.
To add information to the HTML To add content to the HTML
Purpose
document. document.
No (has no effect on content display
Compulsory Yes.
but should be added).
Elements <meta>,<title>,<style>,<link>,<base>, All except those used in head,
inside and<script> like<h1>,<p>,<img>, etc
2. Discuss the benefits of XML schemas to applications.
:- Benefits of XML schemas to applicaiton-
1. XML Schema is an XML- grounded( and more important) volition to DTD.
2. XML Schemas Support Data Types.
One of the topmost strength of XML Schemas is the support for data types.
• It's easier to describe permissible document content
• It's easier to validate the correctness of data
• It's easier to define data angles( restrictions on data)
• It's easier to define data patterns( data formats)
• It's easier to convert data between different data types
3. XML Schemas use XML Syntax
Another great strength about XML Schemas is that they're written in XML.
• You do not have to learn a new language
• You can use your XML editor to edit your Schema files
• You can use your XML parser to parse your Schema files
• You can manipulate your Schema with the XML DOM
• You can transfigure your Schema with XSLT
4. XML Schemas Secure Data Communication
When transferring data from a sender to a receiver, it's essential that both corridor have the same"
prospects" about the content.
5. XML can be used to produce new internet languages.
6. XML increases data vacuity.
7. XML simplifies Platform change.
8. XML simplifies data transport and data sharing.
3. Write a short note on synchronous and asynchronous requests.
:- Asynchronous requests should be preferred to coetaneous requests for performance reasons.
still, you admit a message when the data has been entered, If you use an asynchronous
XMLHttpRequest. This lets the cybersurfer continue to work as normal while your request is
being handled.
Whenever an AJAX request is transferred, it consists of a body, and title information is
transferred to the garçon. The garçon interprets the request and generates a response and sends it
back to the customer. While this process takes time as the response is generated and transferred
over the network. So, if the script makes requests synchronously, it'll make the runner
unresponsive until the response is entered. Asynchronous AJAX requests allow JavaScript to
shoot a request but not to stay for a response. JavaScript can continue to execute other tasks
making the runner responsive while the response is reused. Asynchronous requests can be used
by setting the async parameter in the open system.
Syntax:-
[Link](method,url,async parameter);
The async parameter has a default value of “true”, so it is by default asynchronous, but we can
implicitly type “true”.
Example-
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content=
"width=device-width, initial-scale=1.0">
<title>AJAX Async Requests</title>
<style>
body {
text-align: center;
}
h1 {
padding: 2px;
color: green;
font-size: 3rem;
}
h2 {
font-size: 2rem;
}
div {
font-weight: bold;
}
</style>
</head>
<body>
<h1>GeeksforGeeks</h1>
<h2>AJAX Asynchronous Requests</h2>
<div id="response"></div>
<button onclick="SendAsyncRequest()">Async Request</button>
<button onclick="SendSyncRequest()">Sync Request</button>
<script>
function SendAsyncRequest() {
[Link]('response').innerText = "";
var request = new XMLHttpRequest();
[Link]('GET',
'[Link] true);
[Link] = () => {
[Link]('response').innerText
+= "Response : \n" + [Link];
}
[Link]();
[Link]('response').innerText
+= "\n\n OTHER TASK EXECUTED\n\n";
}
function SendSyncRequest() {
[Link]('response').innerText = "";
var request = new XMLHttpRequest();
[Link]('GET',
'[Link] false);
[Link] = () => {
[Link]('response').innerText
+= "Response : \n" + [Link];
}
[Link]();
[Link]('response').innerText
+= "\n\n OTHER TASK EXECUTED\n\n";
}
</script>
</body>
</html>
Advantages Of Asynchronous AJAX requests
• Improves stoner experience by furnishing continued service.
• Whole runner reloading isn't needed.
• Improves performance of web operations.
Synchronous requests block the prosecution of law which causes" indurating" on the screen and
an unresponsive stoner experience.
A Synchronous request blocks the customer until operation completes i.e. cybersurfer is
unresponsive. In similar case, javascript machine of the cybersurfer is blocked.
The coetaneous request means after making a request; the law prosecution will be blocked until
the response is entered. After transferring the coetaneous request, we can not interact with the
cybersurfer tab until the response is entered.
Example
Using jQuery, let's write an example to test both asynchronous and synchronous requests.
<html>
<head>
</head>
<body>
<!-- include jQuery file-->
<script
src="[Link]
integrity="sha512-aVKKRRi/Q/YV+4mjoKBsE4x3H+BkegoM/em46NNlCqNTmUYADjBbeNefNxYV
7giUp0VxICtqdrbqU7iVaeZNXA==" crossorigin="anonymous" referrerpolicy="no-
referrer"></script>
<script>
function sendRequest(async = true) { // by default we send asynchronous
request
let URL = "[Link] // API which
returns dummy user data
// create a ajax request
$.ajax(URL, {
type: "GET",
async, // if we send async as false then a synchronous request will
be sent
success: (resp) =>{ // this method will be executed when the
response is received from server
let respType = async ? "Async": "Sync";
[Link](`response received for ${respType} reqest`);
}
});
[Link]("After calling ajax request ");
}
[Link]("Send synchronous request");
sendRequest(false);
[Link]("Send Asynchronous request");
sendRequest(true);
</script>
</body>
</html>
4. Explain J2ME architecture.
:- Configuration layer
Includes the JVM, which interacts with the operating system. And also interacts with the profiles
and jvm.J2ME supports Two basic configurations.
CDLC (Connected Limited Device Configuration):
160 - 512 KB of total memory.
16-bit or 32-bit processor.
Low power consumption and often operating with battery power Connectivity with
limited bandwidth.
Connected Device Configuration (CDC):
CDC addresses the needs of devices that lie between those addressed by CLDC and the
full desktop systems running J2SE.
2 MB or more memory for Java Platform.
32-bit processor.
High bandwidth network connection.
full-featured Java 2 virtual machine (CVM).
17packages.
Use for devices like palms.
Profile layer
It provides the java API used to implement the applications for the small computing devices.
Mobile Information Device Profile(MIDP)- provides classes for network connections, user
interface, and persistent storage. Small computing devices have two components provided by the
original equipment manufacturers.
OEM classes- these are used by the MIDP to access the features of the specific devices
such as sending and receiving messages and access persistent storage.
OEM applications- these can be accessed by the MIDP such as address book.
Personal Digital Assistant Profile (PDAP) –CLDC-based, extends MIDP with additional
classes and features for more powerful handheld devices.
Foundation Profile (FP) –CDC-based, extends the CDC with additional J2SE classes.
Personal Basis Profile (PBP) -extends the FP with lightweight (AWTderived) user interface
classes and a new application model.
Personal Profile -extends the PBP with applet support and heavyweight UI classes.
The J2ME architecture comprises three software layers
The first layer is the configuration layer that includes the Java Virtual Machine (JVM), which
directly interacts with the native operating system. The configuration layer also handles
interactions between the profile and the JVM.
The second layer is the profile layer, which consists of the minimum set of application
programming interfaces (APIs) for the small computing device.
The third layer is the Mobile Information Device Profile (MIDP). The MIDP layer contains
Java APIs for user network connections, persistence storage, and the user interface. It also has
access to CLDC libraries and MIDP libraries.
5. What are the basic rules of HTML5?
:-
New features should be based on HTML, CSS, DOM, and JavaScript
Reduce the need for external plugins (like Flash)
Better error handling
More markup to replace scripting
HTML5 should be device independent
The development process should be visible to the public
Browser Compatibility
HTML5 is not yet an official standard, and no browsers have full HTML5 support yet. The
following figures present a classification of different browsers and their compatibility with
HTML5. The score is obtained on a total of 500 established from the 500 latest features of
HTML.
Doctype just got easy
The XHTML 1.0 Strict template for a basic page can be intimidating to look at. By comparison, HTML5
is so simple that you can type it out by hand. Below is a simple HTML5 document, with the minimum of
required tags:
<em>Title of the document</em>
The content of the document......
Character Encoding
HTML 5 authors can use simple syntax to specify Character Encoding as follow:
The
HTML 5 removes extra information required and you can use simply following syntax:
The tag:
So far you were writing as follows:
HTML 5 removes extra information required and you can use simply following syntax:
Semantic Elements
One of the stylish( and, in my opinion, easiest) ways to get started with HTML5 is by using its
new semantic rudiments for describing the structure of runner content.
Before HTML5, inventors generally use IDs and/ or class names with these
markers. This conveys further meaning to the inventors, but unfortunately, it does n’t help
cybersurfers decide the purpose of that luxury.
In HTML5, there are new semantically rich rudiments that can convey the purpose of the
element to both inventors and cybersurfers.
Then are some exemplifications of the new semantic rudiments in HTML5
•This is used for content that can be grouped thematically. A can have a, as well as a. The point
is that all content contained by is related.
• generally contains the caption or grouping of captions for a runner and/ or s, although it can
also contain other supplemental information like ensigns and nautical aids. Notice that I said “
runner and/ ors. ” That means you could have multiple s on a runner.
• is used for content about a runner and/ or s, similar as who wrote it, links to affiliated
information and imprints. And, like, you could have multiple s on a runner.
• is used to contain major navigation links for a runner. While it is n’t a demand, will frequently
be contained by, which, by description, contains nautical information.
• is used for content that's tone- contained and could be consumed independent of the runner as a
whole, similar as a blog entry, is analogous to in that both contain affiliated content. The stylish
rule of thumb for deciding which element is applicable for your content is to consider whether
the content could [Link], is most probably the way to go, If you could give an
snippet or RSS feed for the content.
• indicates the portion of a runner that's parenthetically related to the content around it, but also
separate from that content, similar as a sidebar or pull- quotations. A good system for deciding
whether is applicable is to determine if your content is essential to understanding the main
content of [Link], also is the element to use, If you can remove it without affecting
understanding.
6. Write a short note on the accesskey attribute with an example.
:- The accesskey attribute specifies a shortcut key to activate/focus an element.
Browser Windows Linux Mac
Internet Explorer [Alt] + accesskey N/A
Chrome [Alt] + accesskey [Alt] + accesskey [Control] [Alt] + accesskey
Firefox [Alt] [Shift] + accesskey [Alt] [Shift] + accesskey [Control] [Alt] + accesskey
Safari [Alt] + accesskey N/A [Control] [Alt] + accesskey
Opera 15 or newer: [Alt] + accesskey
Opera
Opera 12.1 or older: [Shift] [Esc] + accesskey
However, in most browsers the shortcut can be set to another combination of keys.
Tip: The behavior if more than one element has the same access key differs:
IE, Firefox: The next element with the pressed access key will be activated
Chrome, Safari: The last element with the pressed access key will be activated
Opera: The first element with the pressed access key will be activated
Example:-
<a href="[Link] accesskey="h">HTML5</a><br>
<a href="[Link] accesskey="c">CSS3</a>