I have several jQuery functions on my website but not on every page all of them are required.
All of them are exectued from one XXX.js file for example:
jQuery(function() {
$(".title").slug({
slug:'slug',
hide: false
}); });
and if any of the elements is missing the rest of the functions are not executed.
How to execute for example this function only if the element exists?
You could check if the element exists like this: