From 4ba9ea717f17fbfb86e5fbab495dc6bac05d5f5e Mon Sep 17 00:00:00 2001 From: xing Date: Mon, 20 Apr 2020 13:30:45 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E5=9B=BE=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tieba page.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tieba page.js b/tieba page.js index cd8d5a0..7e45d8a 100644 --- a/tieba page.js +++ b/tieba page.js @@ -218,13 +218,16 @@ dataType: 'json', success: res => { let imgs = res.data.images; - imgs.splice(0, 3); + dd = [] imgs.forEach((img, i) => { - if (i > num - 4) { + if (i > num - 1) { return; } let div = document.createElement('div'); div.dataset.url = img.url.replace('&src=', '&src='); + if (div.dataset.url.indexOf('&src') < 0) { + div.dataset.url += '?&src=' + div.dataset.url; + } div.dataset.class = 'BDE_Image'; dd.push(div); })