lewisje / svgweb

Automatically exported from code.google.com/p/svgweb
Other
0 stars 0 forks source link

Load event will not fire #521

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
var obj = document.createElement('object', true);
obj.setAttribute('type', 'image/svg+xml');
obj.setAttribute('data', SomeSvgFileUrl);
if (obj.addEventListener) {
  obj.addEventListener('load', function() {
        DoSomethingWhenSvgFileLoads
   }, false);
}
else if (obj.attachEvent) {
    obj.attachEvent('onload', function() {
        DoSomethingWhenSvgFileLoads
   });
}
                    }
svgweb.appendChild(obj, MySvgContainer);

The svg file will display but the DoSomethingWhenSvgFileLoads function will 
never fire. This is is an issue only with the latest release ... it worked fine 
in the previous version.

Original issue reported on code.google.com by FlorinaM...@gmail.com on 21 Jun 2010 at 8:24

GoogleCodeExporter commented 8 years ago
Please don't use bug reports to ask questions. The issue is that the 'load' 
event has been replaced by 'SVGLoad' for better compatibility with third party 
JS libraries.

Original comment by bradneub...@gmail.com on 21 Jun 2010 at 8:59