Bug Tracker

Ticket #4723 (closed bug: duplicate)

Opened 5 years ago

Last modified 2 years ago

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:
Blocking: Blocked by:

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

ie_vml_sizzlepatch.js Download (1.9 KB) - added by windi 5 years ago.
JavaScript file containing the patch for Sizzle
ie_vml_sizzlepatch_2.js Download (3.1 KB) - added by mitya_mukhin 4 years ago.

Change History

Changed 5 years ago by windi

JavaScript file containing the patch for Sizzle

comment:1 Changed 5 years ago by olau

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 4 years ago by mitya_mukhin

comment:2 Changed 4 years ago by mitya_mukhin

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.

comment:3 Changed 4 years ago by snover

  • Status changed from new to closed
  • Resolution set to duplicate

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

Note: See TracTickets for help on using tickets.