Worked great. Thanks alot(allthough I screwed up and got parse errors at first because I copied blanks)!
--- In [email protected], Erik Dahlström <[EMAIL PROTECTED]> wrote: > > On Thu, 25 Jan 2007 09:39:14 +0100, frevi815 <[EMAIL PROTECTED]> wrote: > > > First, as I'm new to this board: Hello everyone! > > > > I'm having trouble importing external SVG with XMLHttpRequest. > > It's inserted in the document but isn't visible. If I look at the > > html-tab in Firebug the new element is there there but it's slightly > > faded out. And when I inspect the DOM-ode of the element the > > namespaceURI is null. I've tried using importNode but i doesn't help. > > The code looks like this: > > > > response = req.responseXML.documentElement; > > importedNode = document.importNode(response, true); > > tempElement = document.getElementById(itemID + "Tank"); > > tempElement.appendChild(importedNode); > > > > The elements is sent over with a very basic php-file: > > <?php > > header('Content-Type: image/svg+xml'); > > echo("<g id='fish'> <rect x='40' y='50' width='140' height='100' > > fill='red' /></g>"); > > ?> > > Remember that you're getting XML elements back unless otherwise specified. > > You can try adding the svg namespace like this: > <?php > header('Content-Type: image/svg+xml'); > echo("<g xmlns="http://www.w3.org/2000/svg" id='fish'> <rect x='40' y='50' > width='140' height='100' > fill='red' /></g>"); > ?> > > Then your elements should become SVG elements. > > Hope this helps > /Erik > > -- > Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ > ----- To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" ---- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

