JavaScript – this keyword usage and binding

JavaScript is very elastic and popular language, but many things may be “strange” if we used soemthing else before. One of important things is that we create a lot of functions, callbacks and everything is asynchronous (if we don’t change this). Other important matter is “this” keyword – may be very unintuitive if we try to use it in similar way to other languages. But this keyword is very powerful and we can simplify our code using this keyword. See few examples in this post.

Continue reading “JavaScript – this keyword usage and binding”

Integrate jQuery with Vue.js

I work with many JavaScript libraries and few frameworks. Sometimes I must “merge” several scripts – not always is simple. One example is Vue.js and jQuery on the same site. It may be strange, because Vue modify and make interface reactivity, and jQuery can also modify DOM. But… in few situations I must do it – because Vue “doesn’t know” data, doesn’t know what and how modify – it can only prepare information for jQuery. Also, it isn’t problem, if we separate both things – jQuery should never touch elements from Vue. Ok, let’s start.

Continue reading “Integrate jQuery with Vue.js”

[HTML][JS] Input + datalist with validation instead of selects

Last time I implemented something like mix of select and input fields. User can type name, but should value in field should be from defined group. It should not only provide selection dropdown menu, but also suggestions during typing. There are a lot of ready solutions, but I decided to use native HTML5 tag – datelist. It’s very nice, so I decided to describe its and some issues with browsers.

Continue reading “[HTML][JS] Input + datalist with validation instead of selects”