これが私のスクリプトです:
function createSummaryAndThumb(pID) {
var div = document.getElementById(pID);
var imgtag = "";
var img = div.getElementsByTagName("img");
var summ = summary_noimg;
if(img.length >= 1) {
imgtag = '<span class="thumbnail pull-left"><img src="' + img[0].srcreplace('/s640/', '/s' + image_size + '/') + '" width="' + img_thumb_width + 'px" height="' + img_thumb_height + 'px"/></span>';
summ = summary_img;
}
var summary = imgtag + '<p>' + removeHtmlTag(div.innerHTML, summ) + '</p>';
div.innerHTML = summary;
}
上記のスクリプトは、/s640を/image_sizeに置き換えます。しかし、「640」の部分の値を変更するために何ができますか。私はこれを試しましたが、うまくいきません-
function createSummaryAndThumb(pID) {
var div = document.getElementById(pID);
var imgtag = "";
var img = div.getElementsByTagName("img");
var summ = summary_noimg;
if(img.length >= 1) {
if (uh>img_thumb_width) imgtag = '<span class="thumbnail pull-left"><img src="' + img[0].src.replace('/s' + uh + '/', '/s' + img_thumb_width + '/') + '" width="' + img_thumb_width + 'px" height="' + img_thumb_height + 'px"/></span>';
summ = summary_img;
}
var summary = imgtag + '<p>' + removeHtmlTag(div.innerHTML, summ) + '</p>';
div.innerHTML = summary;
}