IP Module4,5,6
IP Module4,5,6
Offline use - When connectivity is unavailable, it might still be possible to use an RIA. An RIA
platform let the user work with the application without connecting to the Internet and synchronizing
it automatically when the user goes live.
Consistency of look and feel - With RIA tools, the user interface and experience with different
browsers, devices and operating systems can be more carefully controlled and made consistent.
Direct Interaction - An RIA can use a wider range of controls that allow greater efficiency and
enhance the user experience. In RIAs, for example, users can interact directly with page elements
through editing or drag-and-drop tools. They can also do things like pan across a map or other
image.
RIA Characteristics
Better Feedback - Because of their ability to change parts of pages without reloading, RIAs can
provide the user with fast and accurate feedback, real-time confirmation of actions and choices,
and informative and detailed error messages.
Rapid Development - RIA framework should facilitate rapid development of a rich user experience
through its easy-to-use interfaces in ways that help developers.
The list of current technologies that can be used to build modern RIAs is long.
Here are some of them:
● AJAX
● Adobe Flash, Flex and Adobe Integrated Runtime (AIR)
● Microsoft Silverlight
● Curl (an object-oriented language with embedded HTML markup)
● Google Gears
● OpenLaszlo and Webtop
● Oracle WebCenter
AJAX:
AJAX - Technologies
AJAX cannot work independently. It is used in combination with other technologies to create
interactive webpages.
HTML/XHTML and CSS - used for displaying content and style. It is mainly used for presentation
DOM - For accessing and manipulating structured documents. Represents the structure of XML
and HTML documents. It is used for dynamic display and interaction with data.
XML or JSON - For carrying data to and from server. JSON (Javascript Object Notation) is like
XML but short and faster than XML.
XMLHttpRequest - JavaScript object that performs asynchronous interaction with the server.
JavaScript - It is used to bring above technologies together. Independently, it is used mainly for
client-side validation. Loosely typed scripting language. JavaScript function is called when an
event occurs in a page. Glue for the whole AJAX operation.
How AJAX Works? AJAX communicates with the server using XMLHttpRequest object.
How AJAX Works? AJAX communicates with the server using XMLHttpRequest object.
Properties of XMLHttpRequest
Methods of XMLHttpRequest
AJAX - Simple Example: Write a Ajax code which loads the data from the server and updates the parts of a web page
selectively withoutreloading the entire page.
<form>
<h1> Welcome to <i> My Class </i> </h1>
<input type="button" value="Get Intro" onclick="getIntro();" />
</form>
<div id="list">
</div>
AJAX - Simple Example
What is jQuery?
● jQuery is a small and lightweight JavaScript library.
● jQuery is cross-platform.
● jQuery simplifies HTML document traversing (DOM manipulation), event
handling, animating, and Ajax interactions for rapid web development.
● jQuery means "write less do more".
jQuery Syntax
$(selector).action(call_back function)
Where,
jQuery Syntax
some of the most commonly used selectors.
$(selector).action(call_back function) ● click() Click: This executes on a single mouse
click.
Where, ● hover() Hover: This executes when the
● A $ sign to define/access jQuery mouse is hovered over an element.
● A (selector) to "query (or find)" HTML elements mouseenter() and mouseleave() apply only to
● A jQuery action() to be performed on the element(s) the mouse entering or leaving an element,
respectively.
● submit() Submit: This executes when a form
is submitted.
● scroll() Scroll: This executes when the screen
is scrolled.
● keydown() Keydown: This executes when
you press down on a key on the keyboard.
jQuery Example <body>
Hello All !! This is Sana Shaikh
<html>
<p class="message"> Some are good people. .... </p>
<p class="message"> We like to work with such
<head> people. .. </p>
<p> Goodbye All. .. </p>
<title>The jQuery Example</title>
</body>
</html>
<script
src="https://www.tutorialspoint.com/jquery/jq
uery-3.6.0.js"></script>
<script>
$(document).ready(function() {
$(".message").hide();
Create an HTML form that accepts Emp Id, First_Name and Gender from the user. Write a PHP code to store this information
into the Employee table using MySQL database.
MySQL Database
Create database UserDB
Use UserDB;
Create Emp Table (EID, Name, Gender) in
Database - UserDB
Create table Emp (EID number Primary
key,
Name varchar(10),
Gender varchar(2));
Create an HTML form that accepts Emp Id, First_Name and Gender from the user. Write a PHP code to store this information
into the Employee table using MySQL database.
Emp.html
<html>
<head>
<title>Student Details</title>
</head>
<body>
<h2> Student Registration Form</h2>
<form name="f1" action = "insert.php" method = "POST">
<p> <label> Emp ID: </label>
<input type = "text" id ="eid" name = "eid" /> </p>
<p> <label> Name: </label>
<input type = "text" id ="ename" name = "ename" /> </p>
<p>
<label> Gender: </label>
<input type = "text" id ="gen" name = "gen" />
</p>
<p>
<input type = "submit" id = "btn" value = "STORE" />
</p>
</form> </body> </html>
Create an HTML form that accepts Emp Id, First_Name and Gender from the user. Write a PHP code to store this information
into the Employee table using MySQL database.
Emp.html
<html> insert.php
<head> <?php
<title>Student Details</title> $host = "localhost";
</head> $user = "root";
<body> $password = '';
<h2> Student Registration Form</h2> $db_name = "UserDB";
<form name="f1" action = "insert.php" method =
$con = mysqli_connect($host, $user, $password, $db_name);
"POST">
<p> <label> Emp ID: </label> if(mysqli_connect_errno()) {
<input type = "text" id ="eid" name = "eid" /> </p> die("Failed to connect with MySQL: ". mysqli_connect_error()); }
<p> <label> Name: </label>
<input type = "text" id ="ename" name = "ename" /> $eid = $_POST['eid'];
</p> $ename = $_POST['ename'];
<p> $gen = $_POST['gen'];
<label> Gender: </label> $sql1 = "insert into Emp values ('$eid','$ename','$gen')";
<input type = "text" id ="gen" name = "gen" /> if(mysqli_query($con, $sql1)){
</p> echo "Records inserted successfully.";
<p> } else{
<input type = "submit" id = "btn" value = "STORE" />
echo "ERROR: Could not able to execute $sql1. " . mysqli_error($con);
</p>
}
</form> </body> </html>
?>
Get and Post
methods
in PHP
The GET method supports only string data types, while the POST method supports different data types such as
string, numeric, binary, and so on.
XML
● XML stands for eXtensible Markup Language and it is used for storing
and transferring data.
● It focuses on data rather than how the data looks, is designed to send, store,
receive and display data.
● XML does not depend on software and hardware, it is platform and
programming language independent.
● XML bridges the gap between human readability and machine readability.
Unlike HTML where most of the tags are predefined, XML doesn’t have
predefined tags, rather you have to create your own tags.
● The filename extension of XML is .xml
XML Features
XSL/Transform"> </xsl:for-each>
<xsl:template match="/">
<html> </table>
<body> </body>
<h2> Student's List </h2> </html>
<table border="1"> </xsl:template>
<tr bgcolor="yellow"> </xsl:stylesheet>
<th> RollNo </th>
<th> FName </th>
<th> LName </th>
</tr>
Student.xml
XSLT <?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type = "text/xsl" href = "student.xsl"?>
<class>
<student>
<rollno> 1 </rollno>
<fname> Sana </fname>
<lname> Shaikh </lname>
</student>
<student>
<rollno> 2 </rollno>
<fname> Bushra </fname>
<lname> Shaikh </lname>
</student>
<student>
<rollno> 3 </rollno>
<fname> Bilal </fname>
<lname> Ansari </lname>
</student>
</class>
ReactJS is a declarative, efficient, and flexible JavaScript library for building
reusable UI components.
You’ll need to have Node >= 14.0.0 and npm >= 5.6 on your machine. To create a
project, run:
cd app-sana
npm start
npx create-react-app
app-sana
cd app-sana
npm start
See output
in browser
Open
app-sana in
VS Code
In src
folder,
Open
App.js
Check
output
Return element
should be one
element
Code:
App.js
npx create-react-app app-sana import logo from ‘./log.svg’;
cd app-sana import ‘./App.css’;
npm start import Header from ‘./components/header’;
Syntax:
const element = <h1> Hello world </h1>;
Characteristics of JSX:
● JSX is not mandatory to use there are other ways to achieve the same thing but using JSX makes iteasier
to develop react application.
● JSX allows writing expression in { }. The expression can be any JS expression or React variable.
● To insert a large block of HTML we have to write it in a parenthesis i.e, ().
● JSX produces react elements.
● JSX follows XML rule.
● After compilation, JSX expressions become regular JavaScript function calls.
● JSX uses camelcase notation for naming HTML attributes. For example, tabindex in HTML is used as
tabIndex in JSX.
Code:
import React from 'react';
import ReactDOM from 'react-dom/client';
const myElement = (
<ul>
<li>Apples</li>
<li>Bananas</li>
<li>Cherries</li>
</ul>
);