SVG报错error on line 39 at column 26: Namespace prefix xlink for href on script is not defined
2014-04-15 00:04
567 查看
转自:http://stackoverflow.com/questions/3561270/error-on-line-39-at-column-26-namespace-prefix-xlink-for-href-on-script-is-not
SVG写入image标签时,发现在google和火狐上无法显示,且报错: Namespace prefix xlink for href on script is not defined
后经查询,找到了解决办法:
在命名空间上添加:
实例:
其中红色的命名空间是使google、火狐浏览器兼容SVG的,蓝色的部分是image标签适应google或火狐浏览器的。
SVG写入image标签时,发现在google和火狐上无法显示,且报错: Namespace prefix xlink for href on script is not defined
后经查询,找到了解决办法:
在命名空间上添加:
xmlns:xlink=http://www.w3.org/1999/xlink
实例:
<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" > <circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red"/> <image xlink:href="happy-every-day.jpg" width="96" height="96" /> </svg>
其中红色的命名空间是使google、火狐浏览器兼容SVG的,蓝色的部分是image标签适应google或火狐浏览器的。
相关文章推荐
- DSO激活问题:Transfer structure prefix for source system T90CLNT090 is not defined
- Flex新建组件中添加Style的错误:The prefix "mx" for element "mx:Script" is not bound
- matlab错误:Function 'conv2' is not defined for values of class 'double' and attributes
- 关于VC中 error C2871: 'std' : does not exist or is not a namespace
- NLS_LANG is not defined on the client
- The prefix "mvc" for element "mvc:annotation-driven" is not bound
- Uncaught SyntaxError: Failed to execute 'querySelectorAll' on 'Element': '#00' is not a valid select
- VUE.JS v-for渲染过程中 $index is not defined
- Could not find action or result There is no Action mapped for namespace / and action name . - [unkno
- struts2异常couldn't clear tomcat cache ,There is no Action mapped for namespace [/] and action name [
- PHP Warning: phpinfo(): It is not safe to rely on the system's timezone settings
- <>' operator is not allowed for source level below 1.7
- The prefix "tx" for element "tx:annotation-driven " is not bound The prefix "tx" for element "tx:ann
- Unable to start debugging on the web server. The IIS worker process for the launched URL is not currently running
- The prefix "mvc" for element "mvc:annotation-driven" is not bound 的解决方法
- '<>' operator is not allowed for source level below 1.7
- spring使用AOP时the prefix aop for element is not bound.和no declaration can be found错误
- Linux下kdesvn提交更改时提示Entry for 'xxx' is marked as 'copied' but is not itself sched
- PL/SQL报错:NLS_LANG is not defined on the client.
- Trouble with the private key for “myName” is not installed on this mac