我使用的是:http://code.google.com/p/svg-edit/
我在svgcanvas div html标记中放入了一个硬编码代码:
<div id="svgcanvas">
<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" id="svgroot" height="480" width="640"><svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 640 480" id="svgcontent"><g style="pointer-events: all;"><title style="pointer-events: inherit;">Layer 1</title><ellipse ry="69" rx="90" style="pointer-events: inherit;" stroke-width="5" stroke="#000000" fill="#FF0000" id="svg_1" cy="156.5" cx="286"></ellipse></g></svg><g id="selectorParentGroup"><rect style="pointer-events: none;" display="none" stroke-width="0.5" stroke="#22C" fill-opacity="0.15" fill="#22C" id="selectorRubberBand"></rect></g></svg>
</div>我期望的输出是它应该在其中绘制示例svg代码,但它没有,即使我重新加载页面,它仍然不会出现。
我怎么才能让它出现呢?
谢谢
发布于 2010-06-03 12:47:37
谢天谢地,终于有人在svg-edit的google代码页上回答了我的问题。下面是答案链接:Answer
多亏了阿德维利亚。
<script language="javascript">
$(function() {
setTimeout(function () {
stroke="#000000" stroke-width="5" style="pointer-events: inherit;" rx="30" ry="27"/></svg>');
svgCanvas.setSvgString('<svg xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg" id="svgroot" height="480" width="640"><svg
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 640 480"
id="svgcontent"><g style="pointer-events: all;"><title style="pointer-events: inherit;">Layer
1</title><ellipse ry="69" rx="90" style="pointer-events: inherit;" stroke-width="5" stroke="#000000"
fill="#FF0000" id="svg_1" cy="156.5" cx="286"></ellipse></g></svg><g id="selectorParentGroup"><rect
style="pointer-events: none;" display="none" stroke-width="0.5" stroke="#22C" fill-opacity="0.15"
fill="#22C" id="selectorRubberBand"></rect></g></svg>');
}, 500);
});
</script>https://stackoverflow.com/questions/2910556
复制相似问题