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

Throws an error when used in XHTML context (using Firefox 37), stop working #56

Open
herbalite opened this issue Apr 9, 2015 · 0 comments

Comments

@herbalite
Copy link

When using maphilight with a page served with

application/xhtml+xml;

then Firefox will throw an exception at the line
a.innerHTML = '<v:shape id="vml_flag1" adj="1" />';

I've fixed this by extending the has_VML function using an exception.
Also changed b.adj == "object" to b.adj === "object" to shut up Netbeans from naging about the comparison. But this is not strictly needed to avoid Netscape throwing an error.

has_VML = (function() {
        try {
            var a = document.createElement('div');
            a.innerHTML = '<v:shape id="vml_flag1" adj="1" />';
            var b = a.firstChild;
            b.style.behavior = "url(#default#VML)";
            return b ? typeof b.adj === "object": true;
        }
        catch (err)
        {
            return false;
        }
    })();

Of course, once MSIE 9 is history, the VML part of this plugin could be dropped entirely.

@herbalite herbalite reopened this Apr 9, 2015
drivron added a commit to scenari/maphilight that referenced this issue Feb 25, 2016
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

1 participant