I have seen many plugins that allow us to integrate modal windows in our websites, which contain a lot of javascript code.
On the w3school page they have a modal type made with little javascript code, using GetElementById
, which is part of javascript.
My question is, is it better to use the second option? For the sake of not overloading the site or is the first option better, why?
When I say overload I mean a lot of code. Are there advantages, which ones?
The advantages of using a plugin are:
The disadvantages of using a plugin are:
Therefore, there is no one better than another, but it depends on your needs. If, for example, you just need to show and close a window, it shouldn't take too long to write it in plain javascript, but if you need more functionality, it might be worth spending a few minutes looking for a plugin and not worrying about "amount of javascript". , because possibly writing something similar would also require that amount of code.