问题描述
就是我想在这个Html里点击新建,然后触发onclick="newCanvas()"里的newCanvas()函数,然后可以在这个函数中对svg进行操作,可以清空svg画布(<EMBEDname="webBrush"id=webBrush"src="test5.svg"height="474"width="611"type="image/svg-xml">[/)等操作。请教:这样怎么实现呢?<tablestyle="position:absolute;left:20px;top:30px;"border="0"cellpacing="0"cellpading="0"width="100%"id="TABLE1"onclick="returnTABLE1_onclick()"><tr><tdstyle="width:200px;height:500px"><imgsrc="../../images/drawing/btn/new_out.bmp"border="0"alt="新建"id="new"class='normal'onmouseover="src='../../images/drawing/btn/new_over.bmp'"onmouseout="src='../../images/drawing/btn/new_out.bmp'"onmousedown="this.className='buttonDown'"onmouseup="this.className='buttonUp'"onclick="newCanvas()"style="position:absolute;top:110px;left:30px;width:38px;height:56px"><br/><imgsrc="../../images/drawing/btn/save_out.bmp"border="0"alt="保存"id="save"class='normal'onmouseover="src='../../images/drawing/btn/save_over.bmp'"onmouseout="src='../../images/drawing/btn/save_out.bmp'"onmousedown="this.className='buttonDown'"onmouseup="this.className='buttonUp'"onclick="saveCanvas()"style="position:absolute;top:184px;left:35px;width:27px;height:55px"><br/><imgsrc="../../images/drawing/btn/withdraw_out.bmp"border="0"alt="撤消"id="withdraw"class='normal'onmouseover="src='../../images/drawing/btn/withdraw_over.bmp'"onmouseout="src='../../images/drawing/btn/withdraw_out.bmp'"onmousedown="this.className='buttonDown'"onmouseup="this.className='buttonUp'"onclick="withdrawCanvas()"style="position:absolute;top:254px;left:34px;width:30px;height:48px"></td><tdstyle="position:absolute;left:213px;top:67px;height:500;width:620;"><divid="Div2"style="width=650;height=410"><span><EMBEDname="webBrush"id=webBrush"src="test5.svg"height="474"width="611"type="image/svg-xml"></embed></span></div></td><tdstyle="height:500px;width:194px;"></td></tr></table>
解决方案
解决方案二:
该回复于2007-12-04 11:19:41被版主删除
解决方案三:
该回复于2007-12-04 11:18:58被版主删除
解决方案四:
找资料网上一大堆
解决方案五:
恩vardomm=document.getElementById("svgCanvas").getSVGDocument();可以获得svg文档但是我想保存到服务器。在网上查到这么几句话:varsvg=document.embeds("webBrush");f.svgcontent.value=svg.window.printNode(svg.getSVGDocument());f.submit();但是好像不能用,那个f代表什么意思呢?document.embeds("webBrush");能用到上面那个html里的saveCanvas()js函数里吗?用vardomm=document.getElementById("svgCanvas").getSVGDocument();可以吗