javascript - Only run a function if on X page -


i have js set tabs on 1 page. i'd run function on page prevent undefined not function console errors. how can include conditional if statement this?

$(function() {     $( "#tabs" ).tabs().addclass( "ui-tabs-vertical ui-helper-clearfix" ); }); 

so, like:

if x page {      $(function() {         $( "#tabs" ).tabs().addclass( "ui-tabs-vertical ui-helper-clearfix" );     });  } 

if page has specific class assigned it, or element applies page, can it. this:

$(function() {      if ($('body').hasclass('classname')) {           $('#tabs').tabs().addclass('ui-tabs-vertical ui-helper-clearfix');      } }); 

Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -