I am trying to create a “use” node using javascript, but the result cannot be seen on the screen, does anyone have an idea? By the way, creating some other type works great, for example, creating an ellipse.
Here are the codes.
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content="text/html;charset=UTF-8" /> <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"> </script> <script type="text/javascript"> </script> </head> <body> <div id="left-toolbar" style="float:left;border:1px solid #DDDDDD;overflow:auto"> <input type='button' onclick='onEllipse()' value='ellipse' /><br /> <input type='button' onclick='onUse()' value='use' /><br /> </div> <div id="workarea" style="float:left;border:1px solid #DDDDDD;margin:0px 20px 0px 20px;overflow:auto"> <svg width="1280px" height="720px" viewBox="0 0 1280 720" xmlns="http://www.w3.org/2000/svg"> <defs> <circle id="circle1" cx="35" cy="20" r="20" style="stroke: black; fill: none;" /> </defs> </svg> </div> </body> </html>
source share