我有这个代码创建链接.
/* Create a link to activate the tab */
DOM_a = document.createElement("a");
DOM_a.appendChild(document.createTextNode(t.headingText));
DOM_a.href = "javascript:void(null);";
DOM_a.title = t.headingText;
DOM_a.onclick = this.navClick;
Run Code Online (Sandbox Code Playgroud)
我需要在链接中添加图像,但是当我尝试添加图像代码时:
<img src="typo3conf/ext/ori_proyectos/res/images/interes.png">
Run Code Online (Sandbox Code Playgroud)
我明白了:
Link<img src="typo3conf/ext/ori_proyectos/res/images/interes.png">
Run Code Online (Sandbox Code Playgroud)
并不是:
Link[*_*]
[*_*]图像在哪里
源代码显示如下:
<img src="typo3conf/ext/ori_proyectos/res/images/interes.png">
Run Code Online (Sandbox Code Playgroud)
我不知道怎么写.
谢谢.
Mar*_*sis 32
您也应该使用自己的DOM方法创建图像:
像这样的东西:
var DOM_img = document.createElement("img");
DOM_img.src = "typo3conf/ext/ori_proyectos/res/images/interes.png";
DOM_a.appendChild(DOM_img);
Run Code Online (Sandbox Code Playgroud)
工作示例这里.
| 归档时间: |
|
| 查看次数: |
39281 次 |
| 最近记录: |