{"id":535,"date":"2018-07-27T12:35:38","date_gmt":"2018-07-27T19:35:38","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=3183"},"modified":"2018-07-27T12:35:38","modified_gmt":"2018-07-27T19:35:38","slug":"quick-svg-with-javascript","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=535","title":{"rendered":"Quick SVG with Javascript"},"content":{"rendered":"<p>If you look into creating SVG dynamically with JavaScript you might stumble upon `document.createElementNS`. In most simple cases, you don&#8217;t need to go down that path. Contemporary libraries handle this stuff internally now (<a href=\"https:\/\/github.com\/facebook\/react\/compare\/master...zpao:fuck-svg\" target=\"blank\">they didn&#8217;t always<\/a>) or if you&#8217;re going vanilla&#8230; you can integrate this kind of thing somewhere:<\/p>\n<p><iframe height='300' scrolling='no' title='Inline Svg ES6 Template Literal' src='\/\/codepen.io\/ZevanRosser\/embed\/JBreYj\/?height=300&#038;theme-id=5318&#038;default-tab=js,result&#038;embed-version=2' frameborder='no' allowtransparency='true' allowfullscreen='true' style='width: 100%;'>See the Pen <a href='https:\/\/codepen.io\/ZevanRosser\/pen\/JBreYj\/'>Inline Svg ES6 Template Literal<\/a> by Zevan Rosser (<a href='https:\/\/codepen.io\/ZevanRosser'>@ZevanRosser<\/a>) on <a href='https:\/\/codepen.io'>CodePen<\/a>.<br \/>\n<\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you look into creating SVG dynamically with JavaScript you might stumble upon `document.createElementNS`. In most simple cases, you don&#8217;t need to go down that path. Contemporary libraries handle this stuff internally now (they didn&#8217;t always) or if you&#8217;re going vanilla&#8230; you can integrate this kind of thing somewhere: See the Pen Inline Svg ES6 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-535","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/535","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=535"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/535\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=535"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=535"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=535"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}