javascript - turn off css sheet on specific page -


i'm new jquery , i'm trying turn off specific css sheet when specific page loads. code i've been using , i'm not sure correct.

if(location.pathname=="/mycart") >= 0){      $('link[rel=stylesheet][src~="/media/css/responsive.css"]').remove();  } 

the problem might path name check... also, instead of removing, try disabling stylesheet:

if (location.pathname.indexof('/mycart') >= 0) {     $('link[href*="/media/css/responsive.css"]').prop('disable', true); } 

edit: ~= selector looks space deliminated word, use *= selector instead.

update (full code)

<script> $(function () {   if (location.pathname.indexof('/mycart') >= 0) {     $('link[href*="/media/css/responsive.css"]').prop('disable', true);   } }); </script> 

Comments

Popular posts from this blog

php - Dynamic url re-writing using htaccess -

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -