I'm using html object tag for that. Right now this is loading in Chrome.. But still facing issues with IE8.
<object id="objDiv" type="image/svg+xml">
</object>
And I have a function to load dynamically
function loadVisualization(path) {
Ext.Ajax.request({
url: 'http://url, // a json file
success: function (response, options) {
try {
window.currentVisualization = Ext.util.JSON.decode(response.responseText);
alert(window.currentVisualization);
} catch (e) {
showException(e, 'parsing vis structure');
}
window.currentVisPath = path;
window.currentSVGObject = document.getElementById('objDiv', true);
window.currentSVGObject.setAttribute('type', 'image/svg+xml');
window.currentSVGObject.setAttribute('data', 'http://serverpath' + escape(path) + ".svg");
window.currentSVGObject.setAttribute('svgName', path);
window.currentSVGObject.setAttribute('style', 'width:100%; height:100%');
window.currentSVGObject.addEventListener('SVGLoad' , function () {
removeObjects(window.currentVisPath);
svgOnLoad(this, imagePath);
}, false);
},
failure: function () { alert("Ajax request for visualization failed") }
});
}
Originally Posted by
Vladimir
Hi,
How do you load SVG file without Ext.Net?