我有一个程序返回svg数据,Chrome& Firefox抱怨“显示此内容需要一个插件”。我使用Fiddler跟踪http响应并将数据保存为svg文件。 Chrome / Firefox可以显示svg文件。但是,对于svg数据,在使用xml格式的http响应期间,Chrome / Firefox不会显示。我的svg标题丢失了吗?
SVG数据如下:
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" height="595">
<defs>
<marker refY="5" refX="10" markerUnits="userSpaceOnUse" orient="auto" markerWidth="10" id="rarrow" markerHeight="10">
<path d="M0 0 10 5 0 10z" fill="black"/>
</marker>
<marker refY="5" refX="0" markerUnits="userSpaceOnUse" orient="auto" markerWidth="10" id="larrow" markerHeight="10">
<path d="M0 5 10 10 10 0z" fill="black"/>
</marker>
<linearGradient y2="100%" spreadMethod="pad" y1="0%" x2="0%" x1="0%" id="LG_V_GreenWhite">
<stop style="stop-color:#99FFCC" offset="0%"/>
<stop style="stop-color:white" offset="100%"/>
</linearGradient>
<linearGradient y2="100%" spreadMethod="pad" y1="0%" x2="0%" x1="0%" id="LG_V_WhiteGreen">
<stop style="stop-color:white" offset="0%"/>
<stop style="stop-color:#99FFCC" offset="100%"/>
</linearGradient>
<linearGradient y2="0%" spreadMethod="pad" y1="0%" x2="100%" x1="0%" id="LG_H_RedWhite">
<stop style="stop-color:#FFAEAE" offset="0%"/>
<stop style="stop-color:white" offset="100%"/>
</linearGradient>
<svg:style type="text/css">
<![CDATA[
.hint { font-family: Verdana, sans-serif; font-size: 10pt; stroke: none; fill: grey; }
.hint-area { stroke-width: 1pt; stroke:blue; fill:none; fill:#ffefd3; border :1px; border-style :solid; padding :1; height :14px; width :14px; border-color :#336699;}
@font-face{font-family:'Helvetica';src:url(map_h.cef)}
@font-face{font-family:'CaflischScript-Bold';src:url(map_c.cef)}
]]>
</svg:style>
</defs>
<g id="backlayer"/>
<rect y="30" x="110" height="40" class="party-ext" width="150"/><text y="50" x="185" class="party-title">10.34.160.23:5061</text><text y="62" x="185" class="party-name">601</text><line y1="70" x2="185" x1="185" y2="545" class="timeline"/><rect y="30" x="290" height="40" class="party-int" width="150"/><text y="50" x="365" class="party-title">10.34.160.23:5060</text><text y="62" x="365" class="party-name">SIPServer</text><line y1="70" x2="365" x1="365" y2="545" class="timeline"/><rect y="30" x="470" height="40" class="party-ext" width="150"/><text y="50" x="545" class="party-title">127.0.0.1:5070</text><text y="62" x="545" class="party-name">501</text><line y1="70" x2="545" x1="545" y2="545" class="timeline"/>
<text y="120" x="83" class="time-txt">20140410-170252.083 [1]</text><line y2="120" marker-end="url(#rarrow)" x2="365" y1="120" x1="185" class="party-link"/><text y="115" x="275" class="rq">INVITE sip:501@CA-L02577.na.frs</text><text y="145" x="83" class="time-txt">.083 [2]</text><line y2="145" marker-start="url(#larrow)" x2="365" y1="145" x1="185" class="party-link"/><text y="140" x="275" class="r1">100 Trying</text><text y="170" x="83" class="time-txt">.084 [3]</text><line y2="170" marker-start="url(#larrow)" x2="365" y1="170" x1="185" class="party-link"/><text y="165" x="275" class="r4">401 Unauthorized</text><text y="195" x="83" class="time-txt">.087 [4]</text><line y2="195" marker-end="url(#rarrow)" x2="365" y1="195" x1="185" class="party-link"/><text y="190" x="275" class="rq">ACK sip:501@CA-L02577.na.frs</text><text y="220" x="83" class="time-txt">.087 [5]</text><line y2="220" marker-end="url(#rarrow)" x2="365" y1="220" x1="185" class="party-link"/><text y="215" x="275" class="rq">INVITE sip:501@CA-L02577.na.frs</text><text y="245" x="83" class="time-txt">.088 [6]</text><line y2="245" marker-start="url(#larrow)" x2="365" y1="245" x1="185" class="party-link"/><text y="240" x="275" class="r1">100 Trying</text><text y="270" x="83" class="time-txt">.095 [7]</text><line y2="270" marker-start="url(#larrow)" x2="365" y1="270" x1="545" class="party-link"/><text y="265" x="455" class="rq">INVITE sip:501@127.0.0.1:5070</text><text y="295" x="83" class="time-txt">.098 [8]</text><line y2="295" marker-end="url(#rarrow)" x2="365" y1="295" x1="545" class="party-link"/><text y="290" x="455" class="r1">100 Trying</text><text y="320" x="83" class="time-txt">.123 [9]</text><line y2="320" marker-end="url(#rarrow)" x2="365" y1="320" x1="545" class="party-link"/><text y="315" x="455" class="r1">180 Ringing</text><text y="345" x="83" class="time-txt">.124 [10]</text><line y2="345" marker-start="url(#larrow)" x2="365" y1="345" x1="185" class="party-link"/><text y="340" x="275" class="r1">180 Ringing</text><text y="370" x="83" class="time-txt">.125 [11]</text><line y2="370" marker-end="url(#rarrow)" x2="365" y1="370" x1="545" class="party-link"/><text y="365" x="455" class="r2">200 OK</text><text y="395" x="83" class="time-txt">.126 [12]</text><line y2="395" marker-start="url(#larrow)" x2="365" y1="395" x1="185" class="party-link"/><text y="390" x="275" class="r2">200 OK</text><text y="420" x="83" class="time-txt">.127 [13]</text><line y2="420" marker-end="url(#rarrow)" x2="365" y1="420" x1="185" class="party-link"/><text y="415" x="275" class="rq">ACK sip:501@10.34.160.23:5060;transport=udp</text><text y="445" x="83" class="time-txt">.127 [14]</text><line y2="445" marker-start="url(#larrow)" x2="365" y1="445" x1="545" class="party-link"/><text y="440" x="455" class="rq">ACK sip:501@127.0.0.1:5070;user=phone;transport=udp</text><text y="470" x="83" class="time-txt">20140410-170256.213 [15]</text><line y2="470" marker-end="url(#rarrow)" x2="365" y1="470" x1="185" class="party-link"/><text y="465" x="275" class="rq">BYE sip:501@10.34.160.23:5060;transport=udp</text><text y="495" x="83" class="time-txt">.214 [16]</text><line y2="495" marker-start="url(#larrow)" x2="365" y1="495" x1="185" class="party-link"/><text y="490" x="275" class="r2">200 OK</text><text y="520" x="83" class="time-txt">.214 [17]</text><line y2="520" marker-start="url(#larrow)" x2="365" y1="520" x1="545" class="party-link"/><text y="515" x="455" class="rq">BYE sip:501@127.0.0.1:5070;user=phone;transport=udp</text><text y="545" x="83" class="time-txt">.216 [18]</text><line y2="545" marker-end="url(#rarrow)" x2="365" y1="545" x1="545" class="party-link"/><text y="540" x="455" class="r2">200 OK</text>
</svg>
答案 0 :(得分:0)
正如arkascha建议的那样,检查Web服务器使用SVG文件发回的MIME类型(Content-type)。您可以在Firebug&#34; Network&#34;中看到它的含义。标签。它应该是&#34; image / svg + xml&#34;。如果不是,则需要调整Web服务器配置。