Ticket #4723 (closed bug: duplicate)
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
Change History
Changed 4 years ago by windi
-
attachment
ie_vml_sizzlepatch.js
added
comment:1 Changed 4 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.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

JavaScript file containing the patch for Sizzle