JavaScript JQuery: use element's html() (innerHTML) as a parameter to canvas's drawSvg method jquery element exists,jquery element id,jquery element selector,jquery

I am trying to convert/ put an SVG into a canvas using the drawSvg() function. The command is: ctx.drawSvg(SVG_XML_OR_PATH_TO_SVG, dx, dy, dw, dh);. This works fine when I specifically put the svg in as a parameter, for example: ctx.drawSvg('<svg><rect x="0" y="0" width="100" height="100" fill="red" /></svg>', 0 , 0 , 500, 500);, I end up with a canvas that has a red square in it, which is exactly correct. However, I need to be able to take the Svg tag from the document and use that as a parameter. I've tried a few different methods to do this but none of them work. How can I do it? Here is a jsFiddle page with what I am trying to do. Thanks! http://jsfiddle.net/qDmhV/722/

Answer:1

Background I have ExtJS grid and option to add new row/data into the grid and into the database with the help of AJAX Requirement When adding new data I have two combo boxes A & B, whereas B is ...

Background I have ExtJS grid and option to add new row/data into the grid and into the database with the help of AJAX Requirement When adding new data I have two combo boxes A & B, whereas B is ...

I have a web form with a bazillion check boxes. If the form is filled out incorrectly, none of the check boxes are reset (as an anti-frustration feature). Problem is, the reset button doesn't work to ...

I have a web form with a bazillion check boxes. If the form is filled out incorrectly, none of the check boxes are reset (as an anti-frustration feature). Problem is, the reset button doesn't work to ...

highcharts gets my hour time wrong I'm from venezuela just in case. I doing a real time system where I get in my db the time,seconds and miliseconds like 10:39:09:2 I apply the strtotime($time) then ...

highcharts gets my hour time wrong I'm from venezuela just in case. I doing a real time system where I get in my db the time,seconds and miliseconds like 10:39:09:2 I apply the strtotime($time) then ...

encodeURIComponent escapes all characters except the following: - _ . ! ~ * ' ( ) But is it possible to extend the functionality encode the above special characters as well. I know i can do ...

encodeURIComponent escapes all characters except the following: - _ . ! ~ * ' ( ) But is it possible to extend the functionality encode the above special characters as well. I know i can do ...