Skip to main content

Bug Tracker

Side navigation

#4723 closed bug (duplicate)

Opened June 03, 2009 08:07PM UTC

Closed October 01, 2010 09:10PM UTC

Last modified March 09, 2012 11:48AM UTC

VML + IE + jQuery = "Failed"

Reported by: windi Owned by: john
Priority: undecided Milestone: 1.3.2
Component: selector Version: 1.3.2
Keywords: vml msie selector Cc:
Blocked by: Blocking:
Description

In MSIE7 (what i have tested so far) an error (stating "Failed") is raised whenever a jQuery using PseudoSelectors (:button, :visible, ...) is executed within a page containing VML elements, e.g.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <style type="text/css">v\\: * { behavior:url(#default#VML); display:inline-block }</style>
        ...
    </head>
    <body>
        ...
        <v:shape ... ></v:shape>
        ...
        <script type="text/javascript">
            $(":button"); // This is where the error is raised!
        </script>
    </body>
</html>

After some debugging I discovered the Sizzle.selectors.filters being responsible for the error (though this is definitely a IE-Bug...).

What Google spit out:

ticket:3265, ticket:4016, VML + IE + jQuery 1.3.2 has me confused

Neither of these fixed my problem, so I wrote a tiny patch for jQuery/Sizzle. I'm not sure if this fixes __all__ problems, but ''wfm'' (works for me *smile*)

Please review my code and feel free to use whatever might be usable.

Cheers, Windi ;-)

btw: jQuery is A WONDERFUL PIECE OF CODE !!

Keep on going Guys ;-)

Attachments (2)
Change History (3)

Changed December 12, 2009 02:42PM UTC by olau comment:1

I just saw this too on IE 6. In this case it broke the browser to the extent that I had to restart it, hard reloading the page with Ctrl+F5 wasn't enough.

Changed April 15, 2010 07:22PM UTC by mitya_mukhin comment:2

Windi's patch is great, though it didn't work correctly for me with some selectors (e.g. :radio:checked didn't work). The revised patch is attached above.

Changed October 01, 2010 09:10PM UTC by snover comment:3

resolution: → duplicate
status: newclosed

This is a duplicate of #7071. (More information, as well as a pull request, are available for #7071.)