How to enable js script only on the main page of the site using js. If we are on the main page of the site site.ru or site.ru/index.php, then the script is executed, but not on all others ...

Or for example this option. If any block with class = = "script_no" is present on the page , then the script is not executed, if this block is not present, then it is executed ...

  • 2
    if ($(".script_no").length == 0) { <execute script> } - Igor
  • Thank you very much, this is what you need. - l2banners

0