Axeva Axeva - 2 years ago 87
HTML Question

Why doesn't SVG work on local HTML files?

I'm confused.

If I point by browser (Chrome or Safari on OSX) to this web site, it shows all the SVG perfectly:

Now, if I view source on that page, copy it, and paste it into a new HTML document on my desktop, then view that with either browser, I get no SVG at all.

Why the difference?

Why does SVG work on the web site, but not in the local HTML file?


Answer Source

You renamed it to HTML, and the browser assumes html content.. while the page is text/xml ..

if you rename it to .xml and open it, you will see it just fine..

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download