Solo lectura

Google Chrome - Foro de ayuda

Esta página web es un archivo de los hilos antiguos de los foros de Google. Más información

SVG getSVGDocument error in Chrome

SVG problems in CHROME
20/05/13 14:36
Hello

I'm starting to use SVG and I have the following code:

HTML
<embed id="embed" src="svg.svg" type="image/svg+xml" width="400" height="300" >

<object id="object" data="svg.svg" type="image/svg+xml" width="400" height="300"></object>

Javascript
$(window).load(function (){
//alert("Document loaded, including graphics and embedded documents (like SVG)");

        var svgDoc_embed = document.getElementById("embed").getSVGDocument();
        alert("My svgDoc_embed => " + svgDoc_embed);

        var svgDoc_object = document.getElementById("object").getSVGDocument();
        alert("My svgDoc_object => " + svgDoc_object);        

});

In the FireFox browser works well
My svgDoc_embed => [object SVGDocument]
My svgDoc_object => [object SVGDocument]

but does not work on Chrome browser.
My svgDoc_embed => null
My svgDoc_object => null


I have searched the Internet but can not find anything that works


Any suggestion is welcome
thank you very much

Respuestas (0)