Question
How to execute JS codes on selected Pages, using drupal body class ?
Example : Execute JS only in the front page.
This Script run whin the body
tag contains class='front'
(function ($) {
$(document).ready(function () {
if ($('body').hasClass('front')) {
alert('Hello');
}
});
})(jQuery);
Add new comment