0% found this document useful (0 votes)
22 views

Data

Uploaded by

Kunal Parnami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Data

Uploaded by

Kunal Parnami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 2

======================================================================

===
The exercise for the 2nd Program. This one is on Multi-stage download.
(We will discuss in class in detail. The idea is straight-forward)

The problem statement is as follows.

A book-search web page served by localhost is rich in content and GUI.


It has multiple images to display, a search form for the front-end
user
to search for a book, a set of links which might interest the user and
also general information on how to use the site. Use Multi-stage
download
pattern to demonstrate good user experience with this page. On
entering an
ISBN in the search box and searching for it, return the matching book
from the
server. The server can maintain book information in a text file.

Notes:

1. When you search for the book for an ISBN, no need to read the
database
or files. You can hardcode book details for around 5 ISBNs and
return them
to the client as search results.

For instance, you can return "C_Programming;K&R;Prentice Hall;200"


for ISBN = "102200111" (some random number)

2. The entire page will download in multiple stages.


The content will not come at once. (Why??).
The text content (information about how to use the site) will load
first.(Why??)

3. You can provide a time gap of around 3 seconds before you download
the next content. You have to decide whether you will download the
links
or images (logo etc) or the search box with the button.

4. The hyperlinks (around 4 of them) will be links to library sites of


individual departments. (You can provide static html pages for each
of these links, each page displaying some default text)

5. After the entire download, the page looks as shown in the attached
jpeg.

6. As you make the user wait for more content, you must have place
holders
(possibly <div> elements) which have a "gif" file to convey that
more
information is coming. Use the attached gif file. As soon as the
initial
download is over, the gif will be placed in 3 places (for the
images, the links
and the search box)

7. Each download is accomplished by an AJAX call. Use XHR technique.


The image can be downloaded using image-based AJAX.

8. The book search functionality is also asynchronous and the results


are
appended as an unordered list at the end of the current page. A new
search
will remove the current list and add a new one in its place.

9. The hyperlinks can be stored as a combination of innerHTML and


hrefs in
a file on the server.

Ex:
The file can be named links.text and can have the following
content:
CSE;http://www.cs.pes.edu
ECE;http://www.ec.pes.edu
EEE;http://www.eee.pesit.edu

Now download the file entirely(without reading it on the server).


When opening a connection using XHR, use the following line.

xhr.open("GET", "http://localhost/links.txt",true);

The xhr.responseText will have the entire file contents.

Thus the files required to execute this exercise are:

1) A client side HTML5 file (which has the initial content and also
the
AJAX code to do the Multi-stage download)

2) A text file on the server which has the hrefs' info (see point 9
above)

3) A server side script to execute the search functionality.

4) Images and the gif (see attached along with this instructions
file)

5) Static HTML pages for each of the hyperlinks.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy