Sunteți pe pagina 1din 4

MUTHAYAMMAL COLLEGE OF ENGINEERING, RASIPURAM. -637408.

ANSWER KEY FOR MODEL EXAM I Subject Code/Name: IT2353/ WEB TECNOLOGY Branch: CSE Year & Sem: III/VI PART-A Answer all the questions: (10*2=20) 1) State the use of web server logs and list the contents of a message log.
Use of web server logs: Web server logs record information about server activity. The primary web server log recording normal activity is an access log, a file that records information about every HTTP request processed by the server. A web server may also produce one or more message logs containing a variety of debugging and other information generated by web applications as well as possibly by the web server itself. Contents of a message log: Host name of client machine making the request User name used to log in, if server password protection is enabled Date and time of response, plus the time zone (offset from GMT) of the time Start line of HTTP request (quoted) HTTP status code of response (200 in this example) Number of bytes sent in body of response

2) What is meant by intrinsic event handling? List some intrinsic attributes.


Intrinsic Event Handling In many cases, you won't want the script to run automatically. You might only want the script to run if the user does something (like hovers over, or clicks a link), or once the page has finished loading. These actions are called intrinsic events (events for short). There are many pre-defined intrinsic events that can trigger a script to run. You use event handlers to tell the browser which event should trigger which script. These are specified as an attribute within the HTML tag.

Example: <input type="button" value="Click me..." onclick="alert('Thanks, I feel better now!')"> Intrinsic Attributes

3) State the function of DNS, TCP/IP, UDP, and SMTP.


DNS: A DNS server is any computer registered to join the Domain Name System. A DNS server runs special-purpose networking software, features a public IP address, and contains a database of network names and addresses for other Internet hosts. TCP/IP: TCP facilitates the transmission of data from an application to the computer network using that application. The TCP protocol essentially breaks down data into packets, or groups of related data, and assembles the data into a usable stream when it reaches its destination. IP protocol sends and receives data packets over the internet. The IP protocol also facilitates communication between networked computers by using algorithms, or mathematical computations, to determine the most efficient and least congested channel to forward digital messages. UDP: It provides port numbers to help distinguish different user requests and, optionally, a checksum capability to verify that the data arrived intact. SMTP: It used to transfer email messages between two servers across Internet Protocol networks. SMTP verifies whether the person using SMTP server to send email messages has the right to do so. SMTP delivers the messages to the specified destination and checks whether the messages are delivered successfully. If the messages arent delivered successfully, SMTP notifies the sender through an error message and sends the undelivered message back to the sender.

4) Define DOM.
Document Object Model (DOM), an API (application programming interface) that defines how JavaScript programs can access and manipulate the HTML document currently displayed by a browser. JavaScript programs access the DOM through a host object named document. JavaScript contains no facilities for interacting with a browser or with the document contained in the browser. The definition of the properties of host object, many of which are themselves objects with their own properties, is known as the Document Object Model (DOM).

5) List the ways of positioning an element within a browser window.


Relative positioning .right { position:relative; right:0.25em } Float positioning .bigNum { float:left; font-size:xx-large; font-weight:bold } Absolute positioning .marginNote { position:absolute; top:0; left:-10em; width:8em; background-color:yellow }

6) List the types of event listeners in DOM2.


Mouse, keyboard event listeners addEventListener() removeEventListener() dispatchEvent()

7) Write the purpose of java script debuggers.


A mistake in a script is referred to as a bug. The process of finding and fixing bugs is called debugging and is a normal part of the development process. Debugger is an application that places all aspects of script execution under the control of the programmer. Debuggers provide fine-grained control over the state of the script through an interface that allows you to examine and set values as well as control the flow of execution. Once a script has been loaded into a debugger, it can be run one line at a time or instructed to halt at certain breakpoints. Once execution is halted, the programmer can examine the state of the script and its variables in order to determine if something is amiss.

8) Write a CSS which adds background images and indentation. <html > <head> <title>Background Images</title> <style type = "text/css"> body { background-image: url(john.jpg); background-position: bottom right; background-repeat: no-repeat; background-attachment: fixed; } p { font-size: 18pt; color: #aa5588; text-indent: 1em; font-family: arial, sans-serif; } .dark { font-weight: bold; } </style> </head> <body> <p>When a web server receives a HTTP request from a web browser it evaluates the request and returns the requested document, if it exists, and then breaks the HTTP connection. This document is preceded by the response header, which has details about how to display the document that will be sent by the server. Each time a request is made to the server, it is as if there was no prior connection and each request can yield only a single document. <span class = "dark">This is known as Stateless Connection. </span> THUS THE ANSWER. </p> </body> </html> 9) Write a java script to generate Random image using array. <html> <head> <title>Sorting an Array of Images</title> <script type = text/javascript> var images = [ "dog", "john", "samuel"]; document.write ( <img src = \" +images[ Math.floor( Math.random() * 3 ) ] +.jpg\width=\"960\" height=\"960\" /> );

</script> </head><body><br>Refresh the page to view new image</body> </html> 10) Write a script that changes background color style property in response to user input. <html> <title> Background Colors </title> <body> <h1> <b> background color </b> </h1> <form name="myform"> <input type="text" name="colorname"> <input type = "button" value = "Change color" onclick = "changecolor()"> </form> </body> <script type = "text/javascript"> function changecolor() { var clr = document.myform.colorname.value; document.bgColor = clr; } </script> </html>

S-ar putea să vă placă și