I am trying to create a generated PHP SVG, but I am already stuck in displaying an SVG file with Javascript in it. Javascript is a pan and zoom function.
Code:
<? header("Content-Type: image/svg+xml"); ?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"> <script xlink:href="SVGPan.js"/> <g id="viewport" transform="translate(200,200)"> <polygon points="50,125 100,100 150,125 100,150" fill="green" stroke="black" stroke-width="1" /> </g> </svg>
By opening this in Internet Explorer, I can pan, but I cannot zoom.
By opening this in Google Chrome, the script works correctly, it displays, I can zoom and pan, but I get an error
error in row 10 in column 1: additional content at the end of the document
I searched google for it and stackoverflow, but I can not find a solution.
Could you help me with this?
source share