JavaScript 插入图像
JavaScript inserting images
嗨,我正在尝试在每个页面加载时在特定页面上插入特定图像,但我似乎无法理解它,我的代码看起来像这样
function display() {
coursetitle = (x[i].getElementsByTagName("title")[0].childNodes[0].nodeValue);
coursecode = (x[i].getElementsByTagName("code")[0].childNodes[0].nodeValue);
enrolledyear = (x[i].getElementsByTagName("year")[0].childNodes[0].nodeValue);
semester = (x[i].getElementsByTagName("semester")[0].childNodes[0].nodeValue);
labday = (x[i].getElementsByTagName("labday")[0].childNodes[0].nodeValue);
lectureday = (x[i].getElementsByTagName("lectureday")[0].childNodes[0].nodeValue);
description = (x[i].getElementsByTagName("description")[0].childNodes[0].nodeValue);
graphic = (x[i].getElementsByTagName("graphic")[0].childNodes[0].nodeValue);
document.getElementById("show").innerHTML = "Title: " + coursetitle + "<br />Code: " +
+ coursecode + "<br />Year: " + enrolledyear + "<br />Semester:" + semester +
"<br />Lab Day:" + labday + "<br />Lecture Day:" + lectureday +
"<br />Course Description:<br/>" + description;
我该怎么办?
如果图形值具有图像路径
document.getElementById("show").innerHTML = "Title: " + coursetitle + "<br />Code: " +
+ coursecode + "<br />Year: " + enrolledyear + "<br />Semester:" + semester +
"<br />Lab Day:" + labday + "<br />Lecture Day:" + lectureday +
"<br />Course Description:<br/>" + description + "</br> <img src='""+graphic +"'" /> ";
相关文章:
- 预加载图像并插入DOM
- 使用formData使用ajax将图像插入数据库
- 在其他图像下使用javascript将图像插入html
- 使用javascript将图像插入pdf(Adobe Acrobat Pro)中
- 无法使用ajax序列化功能将图像插入数据库
- 将捕获的图像插入数据库问题(Cordova/SQlite/JavaScript)
- Jquery将图像插入到HTML表中
- 将base64编码的图像插入iOS版Wikitude SDK中的AR.ImageResource
- 使用 XSJS 将图像插入到 SAP HANA 表
- 如何使用 JavaScript 将图像插入 alertify.js alert
- 将图像插入 Outlook 中
- html画布:将多个图像插入到单独的画布中
- 使用谷歌脚本,如何将图像插入表格单元格
- 将数据库mysql中的文件图像插入excel
- 是否可以在渲染前将图像插入缓存
- 在 Javascript 中将图像插入表格单元格
- 将织物图像插入画布
- 是否可以将SVG图像插入到已经呈现在页面上的现有SVG元素中?
- tinymce图像插入,第二次工作,但不是第一次
- 更改url深度与TinyMCE图像插入