0

I am trying to get svg representation of a div.I am using jQuery SVG for this http://keith-wood.name/svg.html

I am doing this on page load:

var pad = null;
    $('.MyDiv').svg({onLoad: function(svg) { 
        pad = svg; 
    } 
    });

and on every change inside div , i am doing this:

var svg = $('.MyDiv').svg('get'); 
alert(svg.text);

but i am getting some JS code in alert. i tried alerting svg.toSVG() but i am getting this :

<svg version='1.1'></svg> in alert

svg.toSVG() seems to work but i am getting empty svg doc even if my div has data in it.

what i am doing wrong here?

4

1 回答 1

0

The innerSVG shim might be helpful to you.

于 2012-07-05T11:35:04.687 回答