Display external SVG with <use> tag and href or xlink:href attribute?
问题 The SVG is not display correctly when it is loaded from <use> tag. I've added an img tag to illustrate the expected result. Code sample: <svg> <use xlink:href="file.svg" href="file.svg"></use> </svg> <img src="file.svg" /> Current output: Working fiddle: demo Thank to anyone who can point out my mistake. 回答1: You have this error: Unsafe attempt to load URL https:.....svg from frame with URL https://...... Domains, protocols and ports must match You need to use the id of the svg object you