Closed
Bug 1059401
Opened 10 years ago
Closed 10 years ago
Loading SVG file using XMLHttpRequest
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 841920
People
(Reporter: igor_kul, Unassigned)
References
()
Details
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0 (Beta/Release)
Build ID: 20140716183446
Steps to reproduce:
Here is a simple (JavaScript) code which works perfectly in all browsers (even in IE!!!) except FireFox (31.0)
var img1 = new Image();
var img2 = new Image();
var link = 'ilib/lin.svg'; // any SVG file.
var xmlSVG = new XMLHttpRequest();
xmlSVG.open( 'GET', link, true );
//xmlSVG.responseType = 'document';
xmlSVG.responseType = 'blob';
// Register the event handler to be called on loading an SVG
xmlSVG.onload = function( e ) {
//img1.src = URL.createObjectURL(new Blob([ new XMLSerializer().serializeToString( this.responseXML )], {type : "image/svg+xml"}) );
img1.src = URL.createObjectURL( this.response );
img2.src = link;
document.body.appendChild( img1 );
document.body.appendChild( img2 );
};
xmlSVG.send();
You can take a look on my webpage.
http://enrisen.com/test.html
Actual results:
"img1" failed to display SVG image while "img2" works
I belive problem is whith in "URL.createObjectURL"
Expected results:
"img1" should display SVG image
Updated•10 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•