/    Sign up×
Community /Pin to ProfileBookmark

hOW TO DISABLE STYLE SHEETS

Hi there,

good morning everybody.

i am working with a javascript toolbar where i am using some small scipt to disable stylesheets used in the page. My code is working fine with almost all sites. but with some sites it is not working i dont know why.

please check my code below.
=================================================

function discss(){
var i=0;
//loop to get the styl sheets
if(document.styleSheets.length>0){
togdis=!document.styleSheets[0].disabled;
for(i=0;i<document.styleSheets.length;i++)
document.styleSheets[i].disabled=togdis;
}//end if
void(togdis=true);

}//end function discss()
=================================================

if you are trying to give a solution for this problem, please try with the following links….

  • 1. [url]www.jimthatcher.com[/url]

  • 2. [url]http://www.austintest.com/language_services.jsp[/url]
  • thank you guys…..

    thanks in advance

    pras

    to post a comment
    JavaScript

    1 Comments(s)

    Copy linkTweet thisAlerts:
    @felgallOct 03.2005 — There are three ways to apply styles in a page.

    <link rel="stylesheet" ...

    <style></style>

    <div style="...

    The code that you have does not test for all of these different ways that styles can be defined.
    ×

    Success!

    Help @prasaddevivara spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.20,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...