createElementNS on IE...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • praskuma
    New Member
    • Mar 2007
    • 4

    #1

    createElementNS on IE...

    Hi All

    document.create ElementNS works fine on firefox, but not on IE.

    I use this fuction to create SVG objects on the fly

    for example.....

    SVG.ns = "http://www.w3.org/2000/svg";
    var svg = document.create ElementNS(SVG.n s, "svg:svg");

    Some of the forums suggested to use document.create Element insteaad of document.create ElementNS on IE......

    But I want to create an elemnt from the name space which is present in "http://www.w3.org/2000/svg"


    how do i do that in IE.

    Thanks
    Prasanna
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    See this thread

    Comment

    • praskuma
      New Member
      • Mar 2007
      • 4

      #3
      Hi

      I read the thread and it points to one more thread

      http://simonwillison.n et/2003/Jun/15/javascriptWithX ML/

      where it says replace all occurences of createElementNS with createElement.

      But my if i say
      document.create Element("svg:sv g");
      thing may not work, since svg:svg is present in the http://www.w3.org/2000/svg namespace, how do i specify that ?

      Thanks
      Prasanna

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Have you read the last comment on that page? IE doesn't understand name spaces because everything is rendered as HTML, not XHTML.

        Comment

        • praskuma
          New Member
          • Mar 2007
          • 4

          #5
          Originally posted by acoder
          Have you read the last comment on that page? IE doesn't understand name spaces because everything is rendered as HTML, not XHTML.
          Ya I agree!!!!!
          But somthing like this may not work..

          document.create Element("svg:sv g");

          Is there an alternative for this ?

          Comment

          Working...