Javascript & Jquery: Advanced Web Technology 09ce1503
Javascript & Jquery: Advanced Web Technology 09ce1503
09CE1503
1
What is Javascript?
● JavaScript is a high-level, interpreted programming language primarily used for
adding interactivity and dynamic behavior to web pages.
● It is one of the core technologies of the World Wide Web along with HTML
(Hypertext Markup Language) and CSS (Cascading Style Sheets).
● JavaScript allows developers to create interactive elements, manipulate the content
of web pages, handle events, and communicate with servers.
● Important functions of JavaScript:-
○ Alert()
○ confirm()
○ Console.log()
○ Document. write()
○ Prompt()
What is Ajax?
● AJAX (Asynchronous JavaScript and XML) is a technique used in web development
to send and receive data from a web server asynchronously without refreshing the
entire web page.
● It allows for dynamic and interactive web applications by enabling data to be
exchanged between the client and server in the background, without disrupting the
user experience.
● Use of Ajax
○ Fetching Data from a Server
○ Form Submissions
○ Dynamic Content Loading
○ Real-Time Updates
○ Autocomplete and Suggestions
AJAX Request
An AJAX (Asynchronous JavaScript and XML) request is a technique used in web
development to send and receive data from a web server asynchronously without
refreshing the entire web page.
AJAX Request
Event Listener
● The primary mechanism for handling events in JavaScript is through event listeners.
● An event listener is a function that is executed in response to a specific event being
triggered.
● You can attach event listeners to HTML elements to listen for events and perform
actions accordingly.
Event Handling
Event Types
Event Object
● When an event is triggered, an event object is created and passed to the event
handler function.
● The event object contains information about the event, such as the type of event,
target element, mouse coordinates, key codes, form data, etc.
Manipulate HTML/CSS using
JavaScript/JQuery
Manipulating HTML Elements
1. Selecting Elements: Use JavaScript or jQuery selectors to target HTML elements
based on IDs, classes, element types, attributes, etc.
Manipulate HTML/CSS using
JavaScript/JQuery
2. Adding or Removing Classes: Change the appearance or behavior of elements by
adding or removing CSS classes.
Manipulate HTML/CSS using
JavaScript/JQuery
3. Modifying Attributes: Change attributes such as src, href, value, etc., to update
element properties dynamically.
Manipulate HTML/CSS using
JavaScript/JQuery
4. Creating New Elements: Generate new HTML elements dynamically and insert them
into the document.
Manipulate HTML/CSS using
JavaScript/JQuery
Manipulating CSS Styles
1. Changing CSS Properties: Modify CSS styles of elements to update their
appearance or layout.
2. Handling Events: Use event listeners or jQuery event methods to respond to user
interactions.