Bug Tracker

Ticket #9807 (closed bug: patchwelcome)

Opened 3 years ago

Last modified 11 months ago

MSIE7/8 alerts a 'Failed' error when trying to get some attributes of VML objects

Reported by: lmeurs Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.6.2
Keywords: Cc:
Blocking: Blocked by:

Description

(Like mentioned at http://bugs.jquery.com/ticket/9105)

MSIE7/8 experiences difficulties with getting some attributes of VML objects, attributes like 'type', 'innerHTML', 'outerHTML' and 'title'.

A simple thing like

alert(document.getElementById('vmlobject').type);

result in a mysterious 'Failed' error.

This bug effects Sizzle and jQuery, since both sometimes try to get the 'type' attribute of an element without checking the tagName first. Sizzle tests this attribute while selecting elements, jQuery tests this attribute when a 'submit' event is bound (actually, the function bound with 'click.specialSubmit' tests it).

I ran into this bug when working with Cufon and jQuery Address and boiled it down to a bare HTML/JS sample, a jQuery sample and a Cufon/jQuery Address sample:
 http://www.wishdesign.nl/fora/msie.vml.attribute.bug/
 http://www.wishdesign.nl/fora/msie.vml.attribute.bug/jquery.htm
 http://www.wishdesign.nl/fora/msie.vml.attribute.bug/jquery.address.htm

Extensively discussed at:  http://www.sitecrafting.com/blog/jquery-cufon-dont-mix/
Reported to Sizzle:  https://github.com/jquery/sizzle/issues/17

(I tried to get a sample work on jsFiddle, but this did not work out because of the bug! See  http://jsfiddle.net/kwsuN/3/)

Change History

comment:1 Changed 3 years ago by john

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

Unfortunately this is not likely something that we'll get around to fixing. If there is a patch (that doesn't cripple performance or bloat file size) then it's certainly something that we'll take a look at:  http://docs.jquery.com/Won%27t_Fix

comment:2 Changed 13 months ago by eng.emad.khalil@…

in the JQuery file u may add this code, it may fix the problem:-

if (e.target.tagName == "shape") {

return false;

}

add it in this place:-

jQuery.event.add(this, "click.specialSubmit", function (e) {

var elem = e.target; if (e.target.tagName == "shape") {

return false;

} var type = elem.type;

comment:3 Changed 11 months ago by gavenkoa

FYI this page still live:  http://contribute.jquery.org/wont-fix/ (support issues with SVG/VML/etc).

Note: See TracTickets for help on using tickets.