浏览代码

changed removeRandomTitle function to replace with space

main
Simon Bowie 2 年前
父节点
当前提交
f105d37960
共有 1 个文件被更改,包括 7 次插入5 次删除
  1. +7
    -5
      site/public/titles.php

+ 7
- 5
site/public/titles.php 查看文件

@@ -41,13 +41,13 @@ foreach ($random_titles as $record_array):
<?
foreach ($record_array as $id => $title):
?>
<a href="id_search.php?id=<? echo $id; ?>&core=all">
<span class="title">
<span class="title">
<a href="id_search.php?id=<? echo $id; ?>&core=all">
<?
echo $title;
?>
</span>
</a>
</a>
</span>
<?
endforeach;
?>
@@ -80,7 +80,9 @@ endforeach;
function removeRandomTitle() {
var elts = document.getElementsByClassName("title");
var RandomSpan = elts[Math.floor(Math.random() * elts.length)];
RandomSpan.innerHTML = "";
var TextReplacement = RandomSpan.textContent.replace(/\w/g,"-");
RandomSpan.removeAttribute("href");
RandomSpan.innerHTML = TextReplacement;
}
</script>
</body>

正在加载...
取消
保存