Main menu

Pages

What is JQuery:



JQuery is not an independent programming language as some might think. It is a free JavaScript library written and developed by John Resig. It allows us to easily add wonderful effects to web pages and easily control many events such as hovering the mouse cursor or clicking the mouse button and others. Many lines of code are few and understandable to beginners, even those who have not studied programming as a specialty.. Also, many describe JQuery as: write less, do more / write less and do more. In fact, this library contains a lot of functions that significantly improve the appearance of the web page and develop its effectiveness. This library can be installed and all you have to do is call the functions you want to use anywhere you want.








How do I get JQuery:



You can download the library for free from this link (just choose the version that suits you)


Why do I use JQuery?:



Ease: Simply, when you visit a web page that uses JQuery, you can view the source of this page and you will see with your own eyes the ease and clarity of the code with a few lines. You can also learn it easily and within a shorter period of time than you think.
Brief: As I mentioned, this library offers its users wonderful software services with very few lines, in exchange for what it offers to developers, designers and programmers of websites.
Control Power: A small library that can do many things with high efficiency. This library gives us quick access to AJAX without effort or long code. Also, controlling the appearance and adding some beautiful and distinctive effects has become easy with this library.
Compatibility: JQuery works efficiently with most browsers, for example: Firefox - Explorer 6+ - Safari - Opera 9+. Also, JQuery is compatible with CSS and you can use it with other libraries without any problems often. (Personally, I haven't tried using it with other libraries)
Flexibility: You can use it in your page in any way you want, whether inline (on the same webpage) or external in a separate javascript file that is called on the page you are using.
* Size: As you will notice when downloading the library, its size does not exceed 117kb, and this, of course, will not cause any burden on your device's memory.
Expansion: Being open source, there will definitely be a lot of add-ons that will offer the developer many great options without any effort.
Help and support: JQuery comes with excellent support and documentaion, in other words you will find a lot of useful information about everything in this library and how to use and install it directly from the person responsible for creating this library. And certainly the information is documented and with a great deal of clarity for the benefit of all users. Also, this library is used very widely by developers and programmers, which gives us a huge amount of information and lessons to help you understand how to use this library and overcome many problems.
How do I use JQuery?:


Usage is easy and simple, once you download the library file, get ready to try it out. Personally, I put the library in a folder where I put all css, JS, Jquery and other common files that I may use frequently. Put the library where you want it or in the same folder as the site. Now on any page you want to use jquery just write this line in the head section:


<script src="website/jquery-1.3.2.js" type="text/javascript"></script>
Of course, if you have placed the library file in another folder, let it be named folder1, the previous line will be:


<script src="../folder1/jquery-1.3.2.js" type="text/javascript"></script>
Then the page will be ready, God willing, to implement the JQuery functions. We can use JQuery in this way, for example:


$(document).ready(function(){
// Here we put the code we want or the effect we want to appear


});
Inside the ready event, we put the function that controls the event.. For example, when I open the page, I want a link to my website's main page to appear, and when I click on it, I don't want it to move it to my page, but I want a welcome to appear in the form of a popup window, which is What is called alert in javascript. In this case, I will write a normal html file.. and I will put in the head part the line that allows me to benefit from the JQuery library. Then I will write the body content and put the link to my page inside it.


In the head part, I will write a simple code that does what I want. I will tell him that there is a script that needs to be executed by me writing this line


<script type="text/javascript">
Then I will start using jquery by writing this function


$(document).ready(function(){
After the bracket I would write:


$("a").click(function(event){
alert("Thanks for visiting me");
});
That is, I told him that when you see a link (a - from the anchor) and it is clicked, I want you to show the visitor a window in which I write what I want in the brackets, and then he will go to my home page. Then I make sure the parentheses are closed so that the operation is done correctly. Thats all about it. All it will do is when it sees the <a> tag in the body it will immediately apply the jquery code and show the welcome window before taking you to the homepage.. (note that the $ sign is in the first line for any use of jquery functions) *This is just a simple example Nothing more, good to start your journey to the world of jquery without complication..


JQuery has many uses, especially in beautiful visual effects. For example, I can write jquery with css selectors with flexibility.


$("classname").click()
This is a simple example that shows what I want: Exactly the same way as before, but we change what is inside ready to:


$("p").click(function(event){
event. preventDefault();
$(this). hide("slow");
});
That is, when there is text in the body part and it is clicked with the mouse button, the text will slowly disappear. And don't forget to change the inside of the body to text with tag: <p>k


* Another example I made to show how to make text

Comments

table of contents title