哪里错了,是动态生成一个图片的代码?

function showCert(){
        var oCert = document.createElement("div");
        oCert.style.height = 700+'px';
        oCert.style.width = 490+'px';
        oCert.style.z-index = 2222;
        var oImg = document.createElement("img");
        oImg.src = "${resourceRoot }/web/ybb/assets/img/main/about2.png";
    oCert.appendChild(oImg);
        document.body.appendChild(oCert);
    }

报错Uncaught ReferenceError: Invalid left-hand side in assignment
index:923 Uncaught ReferenceError: $JssorEasing$ is not defined(anonymous function) @ index:923
7index:265 Uncaught ReferenceError: showCert is not defined

阅读 2.9k
4 个回答
oCert.style.z-index = 2222;  应该是这句吧?zIndex
"${resourceRoot }/web/ybb/assets/img/main/about2.png";

这句问题

报错的,只有最后一个是报了showCert未定义,那就是其它的地方调用的时候引起的错误

 oImg.src = "${resourceRoot }/web/ybb/assets/img/main/about2.png";
 
 字符串里有个变量??
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题