3.3.3 jQuery


jQuery is a Javascript tool or library that we have made available in the app.js file. This means that like our developers, you have access to them on our templates and can develop with SmartWeb.

At SmartWeb we aim to always have the latest version of version 1 from jQuery. jQuery is developed in 2 different versions, version 1 and version 2. Version 2 is for the newest and most modern browsers (Latest Version Chrome, Firefox etc.), Version 1 at the time of this writing is at version 1.12.3.

jQuery can be accessed via the $ variable, it contains lots of exciting tools to make working with browsers and HTML easier. jQuery contains brief tools to choose/find and change HTML elements, tools for animation and tools that take advantage of AJAX (Asynchronous load) calls. Especially the functions of selecting/finding HTML elements is easier than the standard Javascript way and it will also be recognised if you are familiar with HTML and CSS, jQuery works with the same selectors that you find in CSS.

If you want to know more about jQuery you can find more information on their website and in their documentaion.

Examples of how you can use jQuery are shown below:

Choose an #id element

*CODE* *SNIPPIT*(function () {   var element = $("#element"); })();*CODE*

Choose a .class element

*CODE* *SNIPPIT*(function () {   var element = $(".element"); })();*CODE*

Hide an element

*CODE* *SNIPPIT*(function () {   $("#element").hide(); })();*CODE*

Delete an element

*CODE* *SNIPPIT*(function () {   $("#element").remove(); })();*CODE*