How to determine if a user is on the main page using javascript / jquery in Osclass script ads

How to determine if a user is on the main page using javascript / jquery in Osclass script declarations.

I know that a similar function is available in osclass php directories, i.e. osc_is_home_page (), but I need something similar in javascript / jquery.

+4
source share
1 answer

enqueue script only if its main page. Its much more useful.

if(osc_is_home_page()){
     osc_register_script('script_id', 'scriptUrl', 'dependency');
     osc_enqueue_script('script_id');
  }
0
source

Source: https://habr.com/ru/post/1614055/


All Articles