Lecture 1
Lecture 1
c o m )
Introduction to jQuery
LECTURE (1)
What is the purpose of jQuery?
The purpose of jQuery is to make it much easier to use JavaScript on your website and it used to add dynamic
content on your webpage.
What You Should Already Know?
Before you start studying jQuery, you should have a basic knowledge of:
➢ HTML
➢ CSS
➢ JavaScript
What is jQuery?
JQuery is a lightweight, "write less, do more", and JavaScript library.
The purpose of jQuery is to make it much easier to use JavaScript on your website.
JQuery takes a lot of common tasks that require many lines of JavaScript code to accomplish, and wraps them
into methods that you can call with a single line of code.
JQuery also simplifies a lot of the complicated things from JavaScript, like AJAX calls and DOM manipulation.
➢ HTML/DOM manipulation
➢ CSS manipulation
➢ HTML event methods
➢ Effects and animations
➢ AJAX
➢ Utilities
$(selector).action()
1 | P a g e If you have any query joint the facebook group also for help and online lectures and tutorials.
https://www.facebook.com/groups/pofwccteachersofficial
Lecture 1<Introduction to Jquery> Prepared by Mr. Noman Tanseer (N o m a n s h 3 9 @ g m a i l . c o m )
How we can comment in jQuery?
$(document).ready(function(){
});
This is to prevent any jQuery code from running before the document is finished loading (is ready).
It is good practice to wait for the document to be fully loaded and ready before working with it. This
also allows you to have your JavaScript code before the body of your document, in the head section.
Here are some examples of actions that can fail if methods are run before the document is fully loaded:
• Trying to hide an element that is not created yet.
• Trying to get the size of an image that is not loaded yet.
<script src="filename.js"></script>
First Program……..
<!DOCTYPE html>
<html>
<head>
<title>My first Program</title>
<script src="jquery-1.9.1.min.js"></script>
<script type="text/Javascript">
$(document).ready(function(){
alert('jQuery linked successfully');
});
</script>
</head>
<body>
</body>
</html>
2 | P a g e If you have any query joint the facebook group also for help and online lectures and tutorials.
https://www.facebook.com/groups/pofwccteachersofficial