var illustid = location.href.match(/\d+/); var regexp = new RegExp(/member_illust.php\?mode\=manga\&illust_id\=(.+)/); var anchors = document.getElementsByTagName("a");
for (var i = 0; i < anchors.length; i++) { if (anchors[i].href && anchors[i].href.match(regexp)) { anchors[i].href = anchors[i].href.replace(regexp, "member_illust.php?mode=manga_tb&illust_id=" + illustid); } }