2076

CSC329 · TU past paper

Web Technology 2076 question paper

The complete TU 2076 exam paper for Web Technology (CSC329), all 12 questions with solved model answers written to the mark scheme.

Tap a question to open its answer.

  1. 110 marksObjects and propertiesAnswer

    How can you create objects in Javascript? Create a HTML page containing a division with image and its description in paragraph. Write a javascript function to change the value of description in the paragraph during onmouseover and mouseout event on the image.[10]

    An object in JavaScript is a collection of key-value pairs (properties and methods).: "Objects are similar to variables but objects can contain many value of different types. The values are written as name:value pairs." --- The simplest ...

  2. 210 marksPositioningAnswer

    How positioning of HTML elements can be done using CSS? Create a HTML page with a div with some content and two paragraph with some contents having id p1 and p2. Write external CSS for the div tag having fixed position with border style solid and width 2px. the p1 should have relative position. The font type of p1 should be Arial and color should be red. The p2 have absolute position with top 0px and left 200px.[10]

    The position property specifies the type of positioning method used for an element. There are five different position values: Value Description -------------------- static Default; positioned according to normal flow of the page relative...

  3. 310 marksWorking with PHP and MySQLAnswer

    Create web form for book search catalog. The form should contain a dropdown defining search type, a text box for search keyword, a radio button for download type true or false, now write PHP script to store data from the form into database table and also retrive the results from stored table in a new page.[10]

    This solution has three files: - form.html - The search form - store.php - Stores form data into the database - retrieve.php - Retrieves and displays stored results --- --- --- --- --- Step File Action -------------------- 1 form.html Us...

  4. 45 marksHTTPAnswer

    What is HTTP protocol? Define HTTP Request and Response. [5]

    HTTP Protocol: Request and Response

    HTTP Protocol

    HTTP (Hyper Text Transfer Protocol) is the underlying protocol used by the World Wide Web. It defines how messages are formatted and transmitted, and what actions web servers and browsers should take in response to various commands.

    Key characteristics of HTTP:

    • It is based on the client-server model where the client sends a request and the server sends a response.
    • HTTP is implemented over a TCP connection, ensuring reliable data transmission.
    • When a user enters a URL in a browser, an HTTP command is sent to the web server directing it to fetch and transmit the requested web page.

    Working of HTTP (Request-Response Cycle)

    The step-by-step working of HTTP is as follows:

    1. User enters a web address (URL) in the browser.
    2. Browser uses DNS to locate the IP address of the server.
    3. Browser opens a TCP connection to the server.
    4. Browser sends an HTTP Request over the connection.
    5. Server sends an HTTP Response over the connection.
    6. Browser displays the body of the response in the browser window.

    csc329-http-request-response
    

    HTTP Request

    An HTTP Request is a message sent by the client (browser) to the server asking for a specific resource. It typically contains:

    ComponentDescription
    Request MethodType of action: GET, POST, PUT, DELETE, etc.
    URLThe address of the resource being requested
    HTTP VersionVersion of HTTP being used (e.g., HTTP/1.1)
    HeadersAdditional information such as host, content-type, cookies
    BodyData sent to the server (mainly used in POST requests)

    Example of an HTTP Request:

    GET /index.html HTTP/1.1
    Host: www.example.com
    Accept: text/html
    

    HTTP Response

    An HTTP Response is the message sent by the server back to the client after processing the request. It typically contains:

    ComponentDescription
    Status LineHTTP version and status code (e.g., 200 OK, 404 Not Found)
    HeadersMetadata such as content-type, content-length, date
    BodyThe actual content (HTML page, image, data, etc.)

    Common HTTP Status Codes:

    • 200 OK - Request was successful
    • 404 Not Found - Requested resource not found
    • 500 Internal Server Error - Server encountered an error

    Example of an HTTP Response:

    HTTP/1.1 200 OK
    Content-Type: text/html
    Content-Length: 1024
    
    <html>
      <body>Welcome to Example!</body>
    </html>
    

    Summary: HTTP is the foundation of data communication on the web. The client sends an HTTP Request specifying what resource it needs, and the server replies with an HTTP Response containing the requested resource or an appropriate error message.

  5. 55 marksEvents and EffectsAnswer

    How jQuery animate can be used to create custom animation? Write syntax with sample script. [5]

    With jQuery, the animate() method is used to create custom animations by gradually changing CSS properties of an element over a specified duration. It allows developers to animate numeric CSS properties such as width, height, opacity, le...

  6. 65 marksIntroduction to JSONAnswer

    What is the use of JSON? How can you parse a JSON, illustrate with an example. [5]

    JSON (JavaScript Object Notation) is a lightweight, text-based data interchange format used to store and exchange data between a server and a web application. - Used to exchange data between a client and a server in web applications. - U...

  7. 75 marksIntroduction to XML and its ApplicationAnswer

    What is XML? Create an XML file containing records of employee having elements of simple and complex types. [5]

    XML (eXtensible Markup Language) is a markup language designed to store and transport data in a structured, human-readable, and machine-readable format. Unlike HTML, XML does not have predefined tags; instead, users define their own tags...

  8. 85 marksXSD AttributesAnswer

    How XSD of a XML file is created? Illustrate with an example. [5]

    XSD (XML Schema Definition) is a way to describe the structure and constraints of an XML document. It defines: - The elements and attributes that can appear in an XML document - The data types of elements and attributes - The number and ...

  9. 95 marksVariablesAnswer

    How can you define variables in PHP? Define any two variable of string types and display their results after concatenation. [5]

    In PHP, a variable starts with the $ sign, followed by the name of the variable. Variables are like containers for storing data. - A variable starts with the $ sign, followed by the name of the variable. - A variable name must start with...

  10. 105 marksMedia QueriesAnswer

    How web pages can be made responsive using media queries? Illustrate with an example. [5]

    A media query is a CSS technique that applies styles only when certain conditions (such as screen width, device type, or orientation) are met. It allows a single web page to adapt its layout and appearance for different screen sizes (des...

  11. 115 marksHeaderAnswer

    Create a HTML page with tags header, article and footer. Insert alink containing mail to [email protected] in the footer tag. Set the keywords 'iost', 'csit' using Meta tag in the page. [5]

    --- Tag / Attribute Purpose ------ <meta name="keywords" content="iost, csit" Sets the keywords iost and csit for search engines. Goes inside <head. <header Defines the header section of the page (title, intro). <article Defines independ...

  12. 125 marksFramesAnswer

    Why inline frames are used? Create a HTML page containing iframe within a paragraph. The iframe have source to http://www.tuiost.edu.np and its height and width are 200px and 400px respectively. [5]

    As stated in the notes, the <iframe tag defines a rectangular region within the document on which the browser can display a separate document, including scrollbars and borders. Inline frames are used for the following reasons: - To embed...