jQuery

In this article:


    jQuery is a Javascript tool or library that we have made available with app.js file. This means that just like our developers, you have access to use them on the templates you develop at Dandomain Webshop. 

    In the shop system, we strive to use the latest version of version 1 of jQuery. jQuery is developed in two different versions, version 1 and version 2. Version 2 is for new and modern browsers, version 1 supports a wider range of browsers, which is why we have chosen to use version 1.

    jQuery, that can be accessed via the $ variable, contains a lot of exciting tools that make it easier to work with the browser and HMTL. In short, jQuery contains tools for selecting/finding and modifying HTML elements, tools for animation and tools for making AJAX (asynchronous) calls. Especially the function of selecting/finding HTML elements is easier than the standard Javascript approach and will also be recognizable if you are used to using HTML and CSS, as jQuery works with the same selectors you find in CSS.
    If you want to know more about jQuery, you can find information on it on their website and in their documentation at http://jquery.com.

    The examples below briefly show how jQuery can be used:

    Choose an #id element

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

    Choose a .class element

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

    Hide an element

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

    Delete an element

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