Javascript 如何在svg中呈现内部图像标记

Javascript 如何在svg中呈现内部图像标记,javascript,html,image,svg,tags,Javascript,Html,Image,Svg,Tags,这里我正在努力生成带有图像标记的SVG文件。在图像标记中,XLINK:HREF将在预览图像时正确显示图像路径,但不会渲染图像 下面是我的SVG示例代码: <svg width="525" height="300" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"> <g display="" id="front"> <title>Front 1&l

这里我正在努力生成带有图像标记的SVG文件。在图像标记中,
XLINK:HREF
将在预览图像时正确显示图像路径,但不会渲染图像

下面是我的SVG示例代码:

<svg width="525" height="300" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg">

 <g display="" id="front">
  <title>Front 1</title>
  <image xlink:href="/uploads/image_gallery/portrait/879795_print_plus.jpg" src="/uploads/image_gallery/portrait/879795_print_plus.jpg" id="svg_1" height="400" width="400" y="0" x="86"></image>
  <image x="0" y="0" width="5" height="5" xlink:href="http://www.google.co.uk/images/srpr/logo3w.png"></image>
  <rect stroke-width="3" stroke="#000000" fill="#FFF" id="svg_2" height="202" width="202" y="67" x="35"></rect>
  <ellipse ry="77" rx="122" stroke-width="3" stroke="#000000" fill="#FFF" id="svg_3" cy="82" cx="275"></ellipse>
  <line fill="none" stroke-width="3" stroke="#000000" id="svg_4" y2="197" x2="109" y1="75" x1="363"></line>
 </g>
</svg>

前1

加密图像SRC也未正确渲染如何在svg文件中预览时渲染图像?是否有任何错误?

谷歌图像在您显示的区域为白色。把它放大,我就能看到它

<image x="0" y="0" width="35" height="35" xlink:href="http://www.google.co.uk/images/srpr/logo3w.png"></image>


你的javascript在哪里?请将其添加到问题中。@RobertLongson..上面的svg代码是从svg文件中获取的..当我在svg文件中查看时,它存储在svg文件中,该svg文件图像没有正确显示。结果只有空图像!为什么你的标题提到javascript,为什么你要使用javascript和jquery标记呢?