The InternetPopular links

JQuery: connect to a web page

JQuery is a Javascript library that focuses on the interrelated work of HTML, JavaScript, and CSS.

What jQuery is capable of

The library can work with the following list of tasks:

  • Is able to execute the reference to absolutely any element of the object model of the page (DOM) and perform complex manipulations with them;
  • Event processing is supported;
  • There is a functional for various graphics effects and animation;
  • Simplified work with AJAX dynamic loading technology (the function is very important and extremely useful, but not now);
  • JQuery has its own plug-ins in a huge amount, the main function of which is to implement user-friendly graphical interfaces and user interaction with them.

Compressed and uncompressed versions of the library

Developers are available several options for the script - one subjected to compression, the other is not. A full-fledged version is very convenient to use at the stage of coding and debugging (testing) of web applications. Minimalized version, on the contrary, will have little useful advantages during debugging, but it is loaded more often and takes up less space. Thus, it is advisable to use the compressed version of jQuery already in the finished project, because it saves server traffic and space on the disk.

How to choose the right version of jQuery

Today, there are several main directions in jQuery - branches of versions 1.x, 2.x, and 3.x. Their striking difference is that, starting with the second version, any support for obsolete browsers, like the browser from Microsoft Corporation - Internet Explorer, was terminated, up to the eighth version inclusive.

ем данных в библиотеке на десять процентов и немного оптимизировать её работу. This solution allowed to reduce the physical volume of data in the library by ten percent and optimize its work slightly. Nevertheless, there are still home and corporate computers in the world, where the old Internet Explorer is installed as the main browser, although the percentage of these users does not exceed 3% all over the world. Therefore, to maintain an outdated platform or not - you decide.

Developers of jQuery adhere to the principles of backward compatibility of versions. This means that the code written for the version 1.7 library will work also with version 1.8. But sometimes the company-developer removes the least useful functions from jQuery, so it's better to read the documentation for the new version if you are going to upgrade.

In 2016, a new branch of jQuery was released. It became version 3.0, which became even faster and easier than older versions. From it, hacks were finally removed to implement some functions in obsolete browsers, which allowed the library to be positioned as a modern and powerful development tool.

If your project is already tied to a library, then first estimate the labor costs for the upgrade. If the received benefit from the new version will be that - start the work safely. All developers who are just beginning to use the tool in their projects, it is advisable to start directly with the latest versions.

How to get started with jQuery

The first step is to connect to jQuery. To do this, you must directly download the library from the developer resource jquery.com, or from the mirror, and put the library on your web server.

Now let's do jQuery connection to the web page. The script tag is used to connect various scripts in the hypertext markup language. Let's connect jQuery using the following code:

This option is well suited for offline connection, but there are many other ways for server use.

Connecting jQuery with cloud services

Google provides a Hosted Libraries service, using which anyone can connect a popular framework or library to their web application. To connect jQuery through Google Cloud Storage, use the line that corresponds to the selected version in the following way:

The numbers in the graph of versions correspond to the version number, which is available for installation and further work with it. To connect any of the intermediate versions, just copy its numerical number to the connection string instead of the numbers specified in the example.

View the list of current versions you can always go to:

Https://developers.google.com/speed/libraries/#jquery

If for some reason you do not trust Google, but still want to know how to connect the jQuery library from a third-party, reliable server, use the Microsoft repository.

JQuery is one of the best tools for easy creation of animation on web pages. After you realize the power of this tool, you will be very happy that you started to study a similar library.

Skeptics among students and developers believe that it is better to implement everything using a pure programming language, without using third-party libraries. But you need to understand that the jQuery file is only thirty-two kilobytes, and most likely it is already in your user's browser cache if you are connecting the script through Google. So do not be afraid to learn tools that make life easier for the developer. After all, we also connect the jQuery library so that we do not reinvent the bike.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 en.atomiyme.com. Theme powered by WordPress.