13
DecCyber Monday Deal : Flat 30% OFF! + free self-paced courses - SCHEDULE CALL
JQuery is not a programming language that was released in 2006 by John Resig. In fact, this is a well written Java library to simplify traversing between HTML documents, event handling, animation process, or Ajax interactions for easy web development. When you are planning to work with JQuery, you should be aware of basics of HTML, CSS, and JavaScript.
Licensing – This is an open source project licensed by both MIT and GNU. If you have used Microsoft IDE 2010 for Visual Studio then you can see jQuery has already been integrated into the program and easy to access by users worldwide. As a result, jQuery has been declared an official integration for IDE Visual Studio 2010.
In this tutorial, we will discuss jQuery basics and how to use it along with your program to increase overall productivity and functionality. JQuery is well written compact JavaScript code enables developers to manage critical UI functionalities by writing the small number of code lines only. In this way, the JavaScript library not only increases the overall productivity of developers but minimizes overall development time too.
<script type="text/javascript" src="jQuery-1.4.1-min.js"></script>
The simple code allows you to include jQuery file into your web page. This code is generally written under the <head> </head> tag or you may use anywhere you want it.
Based on functionality, the meaning of jQuery-x.x.x.js and jQuery.x.x.x min.js is same. But if we talk about the performance then they should be used carefully.
Read: What Is The Process To Run A Java Program In CMD?
Master/Template page is designed with an objective to create a consistent look for an application. However, if you have loaded jQuery file into the master page then it should not be referred into a content page. In short, jQuery file should be loaded only once either into a master page or content page otherwise it may result into the error.
The overall size of a file is really small that can be downloaded in seconds. Also, it is faster and takes less time to create highly complex UI functionalities.
Almost all versions are same; just more features are added to make it better and faster. Obviously, you should always use the latest version that can deliver maximum features and functionalities. By availing latest version, you can make sure that earlier functionalities are still working and you can use additional features too.
Don’t panic. This will not affect product performance at all. Even if you are using the older version, web pages can be accessed in the same way as earlier. In case, you wanted to use some functionality that is defined for newer version only then you have to upgrade for the latest version.
CDN is a group of multiple computers that are connected somehow with similar data files. The user can access the file from computer server nearest to its location and it makes overall access to web pages easy and faster. Clients don’t have to access the same server that optimizes latency time and you don’t have to wait for particular web page more as it was done earlier. In this way, overall performance and reliability over the network have been increased positively.
Read: Difference between Array Length vs String Length () Function in Java
By including this simple code in your web page, you may quickly load jQuery file from Microsoft AJAX CDN (Content distribution network). You can use this code anywhere but this would be great if this is written under the <head> </head> tag.
<script type="text/javascript" language="Javascript"
src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.4.1.min.js"></script>
By including this simple code in your web page, you may quickly load jQuery file from Google Libraries API (Application programming interface). You can use this code anywhere but this would be great if this is written under the <head> </head> tag.
<script type="text/javascript" language="Javascript"
src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js">
</script>
You must be thinking why jQuery should be loaded from CDN when it is available on your own server. The answer is really simple and logical too. When any web page is accessed through server then cache copy is stored on your system for quick access of files. The same concept is true for content distribution networks too. The pages or jQuery files that have been accessed earlier can be loaded quickly than you ever expected. The browser will access the cache copy and it doesn’t have to be loaded again.
There are two popular ways how jQuery code can be executed –
1). Execute the jQuery code as soon as file gets loaded
Read: A Complete ReactJS Tutorial in 2023
<script language="javascript" type="text/javascript">
$(function () {
$("#div1").css("border", "2px solid green");
});
</script>
or
<script language="javascript" type="text/javascript">
$("#div1").css("border", "2px solid green");
</script>
<script language="javascript" type="text/javascript">
$(document).ready(function () {
$("#div1").css("border", "2px solid green");
});
</script>
The first execution method may be faster but second technique is safer and recommended too. How jQuery should be used in your favor completely depends on developers. However, based on my personal experience I prefer second execution technique the most where the complete page has been loaded and I am just ready to play with elements.
A dynamic, highly professional, and a global online training course provider committed to propelling the next generation of technology learners with a whole new way of training experience.
Cyber Security
QA
Salesforce
Business Analyst
MS SQL Server
Data Science
DevOps
Hadoop
Python
Artificial Intelligence
Machine Learning
Tableau
Search Posts
Related Posts
Java Tutorial For Beginners: A Step-By-Step Guide 566.9k
How to Create Object in Java with Examples? 553.7k
Java Learning & Certification Path: Start Coding Your Way to Excellence 890.3k
What is OOP? A Quick Glance at Java OOPs Concept 598.1k
What is the Difference between JavaScript and JQuery? 296.9k
Receive Latest Materials and Offers on Java Course
Interviews