How to stop broken images showing

后端 未结 12 2381
谎友^
谎友^ 2021-01-02 12:08

I have a table with some images that I want to start out with no images in them.I have set the src=\"\".But when viewed in a browser it shows broken image pics.



        
12条回答
  •  不知归路
    2021-01-02 12:34

    I’d suggest using CSS to hide the image tags initially:

    
    

    Then amend that from your JavaScript when you add the image URL:

    yourImgObject.src = 'IMAGEURL';
    yourImgObject.style.visibility = 'visible'
    

提交回复
热议问题