Connecting Tech Pros Worldwide Help | Site Map

createElementNS on IE...

  #1  
Old May 3rd, 2007, 06:21 AM
Newbie
 
Join Date: Mar 2007
Posts: 4
Hi All

document.createElementNS 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.createElementNS(SVG.ns, "svg:svg");

Some of the forums suggested to use document.createElement insteaad of document.createElementNS 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
  #2  
Old May 3rd, 2007, 12:02 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,520
Provided Answers: 12

re: createElementNS on IE...


See this thread
  #3  
Old May 4th, 2007, 07:10 AM
Newbie
 
Join Date: Mar 2007
Posts: 4

re: createElementNS on IE...


Hi

I read the thread and it points to one more thread

http://simonwillison.net/2003/Jun/15/javascriptWithXML/

where it says replace all occurences of createElementNS with createElement.

But my if i say
document.createElement("svg:svg");
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
  #4  
Old May 4th, 2007, 03:35 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,520
Provided Answers: 12

re: createElementNS on IE...


Have you read the last comment on that page? IE doesn't understand name spaces because everything is rendered as HTML, not XHTML.
  #5  
Old May 7th, 2007, 07:21 AM
Newbie
 
Join Date: Mar 2007
Posts: 4

re: createElementNS on IE...


Quote:
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.createElement("svg:svg");

Is there an alternative for this ?
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
FF SVG and DOM Level 1 Aaron Gray answers 10 December 23rd, 2006 05:15 PM
SGV Aaron Gray answers 11 December 18th, 2006 01:25 PM
using document.createElementNS or document.createElement James Black answers 10 May 25th, 2006 12:15 PM
Outputting MathML via Javascript BakedBean answers 3 December 14th, 2005 04:35 PM