0% found this document useful (0 votes)
11 views3 pages

Wpcit 2

Uploaded by

Vishnu Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

Wpcit 2

Uploaded by

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

Unit III

1. Categories of JavaScript Objects:

o Native Objects: Built-in objects provided by JavaScript (e.g., Array, Date, Math,
RegExp).

o User-defined Objects: Custom objects created by developers to represent data or


behavior specific to the application.

2. Inbuilt JavaScript Methods:

o Common methods include:

 toString(), valueOf() (Object methods)

 push(), pop(), shift(), unshift() (Array methods)

 charAt(), concat(), indexOf(), split(), slice() (String methods)

 parseInt(), parseFloat(), isNaN() (Number methods)

 setTimeout(), setInterval() (Timer methods)

3. Forms of JavaScript Event Handlers:

o Inline event handlers: Defined directly within HTML elements (e.g., <button
onclick="myFunction()">Click me</button>).

o Traditional event handlers: Assigned using JavaScript properties (e.g.,


element.onclick = function() {...}).

o Event listener methods: Attached via addEventListener() (e.g.,


element.addEventListener("click", myFunction)).

4. Comparison between Servlet and Java Server Pages (JSP):

o Servlet:

 Java code embedded within an HTML template.

 More control over logic but harder to maintain HTML content.

o JSP:

 Primarily HTML with embedded Java code (using JSP tags).

 Easier to maintain and modify presentation logic, especially for designers.

5. Various Elements in JSP:

o Directives: Controls overall structure (e.g., page, include, taglib).

o Scriptlets: Java code within <% ... %>.

o Expressions: Shorter code evaluations within <%= ... %>.

o Declarations: Variables or methods defined in <%! ... %>.

o Actions: Tags for tasks like jsp:include, jsp:forward.


6. String Methods in JavaScript:

o Common string methods include charAt(), concat(), indexOf(), replace(), slice(),


split(), substring(), toLowerCase(), and toUpperCase().

7. Comparison of let vs var:

o var: Function-scoped, can be redeclared, and hoisted.

o let: Block-scoped, cannot be redeclared within the same scope, and not hoisted in
the same way as var.

8. Comparison of GET and POST Methods:

o GET: Sends data via URL query parameters; data visible in the URL; has a limit on
data size; idempotent.

o POST: Sends data in the request body; data is not visible in the URL; no size limit;
typically used for non-idempotent operations.

9. Comparison of getParameter() and getParameterValues():

o getParameter(): Retrieves a single value for a specified parameter.

o getParameterValues(): Retrieves multiple values for a parameter that may have


multiple values (e.g., checkboxes).

10. JSTL (JavaServer Pages Standard Tag Library):

o A collection of JSP tags for common tasks like conditional logic, iteration, string
manipulation, and internationalization.

Unit IV

1. Where PHP is Used:

o PHP is used in web development to create dynamic web pages, handle form
submissions, manage sessions, and interact with databases.

2. Five Important Characteristics of PHP:

o Open-source and free.

o Platform-independent.

o Embedded directly in HTML.

o Server-side scripting language.

o Supports various databases (e.g., MySQL, PostgreSQL).

3. Distinction between print and echo Statements in PHP:

o print: Returns a value (1), can be used in expressions, and outputs a string.

o echo: Does not return a value, can take multiple parameters, and is generally faster
than print.
4. Different Types of PHP Built-in String Functions:

o Functions include strlen(), strpos(), substr(), strtolower(), strtoupper(), trim(),


str_replace().

5. Comparison of HTML and XML:

o HTML: Designed for displaying data with a focus on presentation.

o XML: Designed to store and transport data with a focus on structure and self-
description.

6. PHP Magic Constants:

o Special constants that change depending on their context (e.g., __LINE__, __FILE__,
__DIR__, __FUNCTION__, __CLASS__, __METHOD__, __NAMESPACE__).

7. PHP Dynamic Functions:

o Functions that are created or called dynamically using variable names (e.g., using
variable function names: $func = 'myFunction'; $func();).

8. Syntax of foreach Loop with Example:

php

$arr = array(1, 2, 3, 4);

foreach ($arr as $value) {

echo $value;

You might also like