SoftTimur SoftTimur - 1 year ago 65
HTML Question

Make a html or xhtml page with svg displayed in local

I have a

page which have a svg. I use
Chrome 54.0.2840.98 (64-bit)
as web browser in Mac OS.

The svg is displayed well with localhost, whereas it is not displayed when i specify
in the browser path.

I have searched some threads, some suggested to change the page to
, I did it. And make the header as follows:

<html xmlns="">
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />

But the svg is still not shown in local.

Could anyone help?

PS: Here is the file. After downloading it, you may need to change the name

Edit: This thread mentions that
Chrome may block the access to local documents (Object in your case) from remote scripts (svg-pan-zoom)
. Is there a way that I rewrite the page to find a workaround? Or could I do something about Chrome settings? I really don't want to use

Answer Source

As Chainat and I discovered (in comments), the key is to write <script src=""></script> (over <script src=""></script>) if one wants to use external d3. Then even a html file without <html xmlns=""><meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" /> works...

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