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

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -