svgweb fails on IE7 and IE8

Issue #265 resolved
created an issue


Under heading Embedding SVG, we must replace data attribute with src and type with classid. SVG items do not currently display under IE7 (or IE8 because of next problem).

{{{ The second way to embed SVG is with the the OBJECT tag, which will work on Internet Explorer as well. Example:

<!--[if !IE]>--> <object data="scimitar.svg" type="image/svg+xml" width="1250" height="750" id="mySVGObject"> <!--<![endif]--> <!--[if lt IE 9]> <object src="scimitar.svg" classid="image/svg+xml" width="1250" height="750" id="mySVGObject"> <![endif]--> <!--[if gte IE 9]> <object data="scimitar.svg" type="image/svg+xml" width="1250" height="750" id="mySVGObject"> <![endif]--> <h1>Put optional fallback content here</h1> </object>

Notice the Internet Explorer conditional comments. The first OBJECT tag is for standards-compliant browsers while the second and third tags are for Internet Explorer. This format is necessary for robust IE support, including IE 6, 7, 8, and 9. }}}

Under heading Knowing When Your SVG Is Loaded, there seems to be a test required before loading jquery. With IE8 on W/7 and IE8 on W/XP, jquery throws an error if svg.js is loaded. When a page is refreshed, this happens even if there are no SVG items on the page and common.js is renamed so as to not load.

{{{ Note that if you are using a window.onload listener for something else (or using something like JQuery's $(document).ready() function), you should also make sure that SVG Web is done loading:

// JQuery onload $(document).ready(function() { window.addEventListener('SVGLoad', function() { // ready to work with SVG now }, false); });

// window.onload window.onload = function() { window.addEventListener('SVGLoad', function() { // ready to work with SVG now }, false); } }}}

Comments (4)

  1. RogerHaase reporter

    There problem appears to be a conflict between svgweb and jquery independent of Moin2.

    A test page demonstrating the problem is here: View the source to see the differences beween the compliant and IE8 versions of the object tag.

    A screenshot of the IE8 result is here:

    A screenshot of the IE7 result is here:

    IE8 is able to display the compliant version of the object tag (with the help of svgweb). IE 7 cannot.

    Even though there is an error in jquery, both IE8 and IE7 display the page as expected (more or less).

    Currently, IE7 and IE8 do not display svg items on moin2 and all of the functionality in common.js is disabled because of the error. Until this problem can be resolved, it seems best to not load svgweb.js. Downside is IE7 and IE8 cannot display svg items, the name of the svg item will be displayed instead.

  2. RogerHaase reporter

    Mitigated by 7bfcad341121.

    IE8 now displays svg images, but will show a javascript error in the status bar on about 10-20% of pages. The error is unpredictable and appears to be caused by a conflict in the initialization routines in svg.js and jquery.js. The problem is documented here:

    The error has no apparent detrimental effects -- all common.js initialization run and svg images display as if there were no error.

    IE7 does not display svg objects. Doing so requires changing to output object tags with non-standard attributes when the user's browser is IE7 or below.

    Related notes: IE7 and IE8 do not display transcluded external web pages. See issue 256 for svgweb issues related to IE9.

    Leaving this issue open for now as a reminder to watch for a new release of svgweb. The priority of this issue should be set to minor.

  3. RogerHaase reporter

    There have been no enhancements to svgweb for over a year. The initialization conflict between svgweb and jquery remains. As we like jquery better than svgweb and ie8 users continue to decline in number, we have discontinued use of svgweb.

    Net result is IE8 users will not see svg images in moin2. Fixed by 0aee7913a866.

  4. Log in to comment