Skip to content

SVG Issues #142

Closed
Closed
@PaulBGD

Description

@PaulBGD

I'm having trouble displaying my SVG. There's a few issues that I'm seeing occurring:

  1. The namespace ends up being [object Object]? Examples:
var svg = document.createElementNS( '[object Object]', 'svg' );
var defs = document.createElementNS( '[object Object]', 'defs' );
var path = document.createElementNS( '[object Object]', 'path' );
  1. My defs object doesn't get populated with styles:
    Input:
        <defs>
            <style>.dev-1{fill:#38aecc}.dev-2{fill:#022f40}.dev-3{fill:#fff}.dev-4{fill:#5f5}</style>
        </defs>

Output:

	var defs = document.createElementNS( '[object Object]', 'defs' );
	
	svg.appendChild( defs );
  1. For some reason there's this random text node thing occurring after every single element:
	svg.appendChild( document.createTextNode( "\n        " ) );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions