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

Jquery: Write Less, Do More

jQuery is a JavaScript library that simplifies HTML document traversal and manipulation, as well as event handling, CSS animation, and Ajax. It works by building an abstraction layer on top of the browser's Document Object Model (DOM) and normalizing the interface across browser differences. A web page is loaded into the DOM as a tree of nodes that can be programmatically manipulated to change what is displayed. jQuery simplifies this by allowing selection of nodes using CSS-style selectors and providing methods for common tasks like adding and removing nodes, handling events, implementing effects and animations, and loading remote data.

Uploaded by

Abbas Hashmi
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views

Jquery: Write Less, Do More

jQuery is a JavaScript library that simplifies HTML document traversal and manipulation, as well as event handling, CSS animation, and Ajax. It works by building an abstraction layer on top of the browser's Document Object Model (DOM) and normalizing the interface across browser differences. A web page is loaded into the DOM as a tree of nodes that can be programmatically manipulated to change what is displayed. jQuery simplifies this by allowing selection of nodes using CSS-style selectors and providing methods for common tasks like adding and removing nodes, handling events, implementing effects and animations, and loading remote data.

Uploaded by

Abbas Hashmi
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 13

jQuery

Write less, Do more

Who uses jQuery?

Browser
Interprets and displays web files Receives response -> Parses the HTML -> DOM tree is built -> Renders the page
<html> <body> <p> Hello World </p> <div> <img src="example.png"/></div> </body> </html>

DOM
A Web page is parsed into a tree of nodes called the DOM Changing the DOM programmatically changes the view DOM is declarative
var body = window.document.body; body.innerHTML = '<b>Hello <i>World</i>!</b>'; var person = body.getElementsByTagName('i')[0]; person.textContent = Abbas';

Problem Statement
I want to load data from database on web page without reloading the rest part of the page. Also I must be able to search data on the page again without refreshing page. Also I must be able to do pagination of retrieved data Both choices should be available for user

Setting up jQuery
Include jQuery on page
<script type="text/javascript" src="jquery-1.4.4.min.js"></script>

Set jQuery to run when DOM is loaded


$(document).ready(function() { //put your $ code here }

HTML page
Giving choice for Load data to some table. Its initially blank.

Load Data
Used method is post
Manipulation

Data is loaded from file through a servlet. Here the Url GetTableFile is mapped with servlet.
Selectors

Search
The event is keyup search data.
Effects

Traversing

Find some HTML and do something to it

Pagination
Core

Create page_navigation options first


CSS

Create methods next, previous and goto


Attribute

jQuery Structure
Core. Selectors. Attributes. Traversing. Manipulation. CSS. Events. Effects. Ajax.

DEMO

Thank You !

You might also like