Connecting Tech Pros Worldwide Help | Site Map

createElementNS on IE...

 
LinkBack Thread Tools Search this Thread
  #1  
Old May 3rd, 2007, 05:21 AM
Newbie
 
Join Date: Mar 2007
Posts: 4
Default createElementNS on IE...

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
Reply
  #2  
Old May 3rd, 2007, 11:02 AM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,232
Default

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

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
Reply
  #4  
Old May 4th, 2007, 02:35 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,232
Default

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

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
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.