解决读取到的微信用户头像太大问题

<script>
    var img = document.getElementsByTagName("img");
    var str = [];
    var url = document.location.href;
    for (var i = 0; i < img.length; i++) {
        var src = img[i].src;
        if (src !== url) {
            str[i] = src.substring(0, src.length - 2);
            img[i].src = str[i] + "/46";  
        }
        else {
            img[i].src = "/img/emptyImageUrl.jpg";
        }       
    }
</script>

 

posted on 2017-01-05 14:37  阿门668  阅读(1454)  评论(0编辑  收藏  举报

导航