Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SYNTAX_ERR: DOM Exception 12 #9

Open
anjitech opened this issue Mar 22, 2012 · 1 comment
Open

SYNTAX_ERR: DOM Exception 12 #9

anjitech opened this issue Mar 22, 2012 · 1 comment

Comments

@anjitech
Copy link

Love your scripts but ran into a problem while using it with MSIE 9. Kept getting a "SYNTAX_ERR: DOM Exception 12, line 131, cssSandpaper.js" error. Everything worked fine but the error kept coming up.

I checked the js file and found it has to do with the querySelectorAll, which after looking around found can be a pain at times. To fix the problem I wrapped the call in a try...catch statement as such:

function fixOpacity() {

    var transformRules = getRuleList('opacity').values;

    for (var i in transformRules) {
        var rule = transformRules[i];
        try {
            var nodes = document.querySelectorAll(rule.selector);

            for (var j = 0; j < nodes.length; j++) {
                me.setOpacity(nodes[j], rule.value)
            }
        } catch (e) {
        //do nothing
        }

    }

}
@aand16
Copy link

aand16 commented Feb 28, 2014

I'm still getting the error with IE9 :

DOM Exception: SYNTAX_ERR (12) 
cssSandpaper.js, line 413 character 13

-that's inside fixLinearGradients()

It would be nice to wrap all querySelectorAll in try/catch (and also show the error inside the selector some way - sorry I'm not knowledgeable enough to do it myself).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants