jQuery/JavaScript to replace broken images

后端 未结 30 2611
我寻月下人不归
我寻月下人不归 2020-11-21 05:50

I have a web page that includes a bunch of images. Sometimes the image isn\'t available, so a broken image is displayed in the client\'s browser.

How do I use jQuery

30条回答
  •  太阳男子
    2020-11-21 06:23

    Better call using

    jQuery(window).load(function(){
        $.imgReload();
    });
    

    Because using document.ready doesn't necessary imply that images are loaded, only the HTML. Thus, there is no need for a delayed call.

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题