cannot load >

前端 未结 4 1064
日久生厌
日久生厌 2021-01-29 06:17

I\'m implementing as simple image gallery.

This is what I got for now

function init(){
  var elem = document.createElement(\"img\");

  elem.scr=\'upload         


        
4条回答
  •  迷失自我
    2021-01-29 06:58

    You have probably made a typo, using scr="..." instead of src="....".

    I highly suggest that you use some element inspectors in browsers such as firebug (Mozilla Firefox), DragonFly (Opera) or Chrome built-in tool to check how the code is finally formed in the page when loaded and easily locate those types of errors. They are easy to use, they allow you to test and make such modifications in html/js/css on-the-fly and they can save you a lot of time.

提交回复
热议问题