Browse Source

changed removeRandomTitle function to replace with space

main
Simon Bowie 2 years ago
parent
commit
f105d37960
1 changed files with 7 additions and 5 deletions
  1. +7
    -5
      site/public/titles.php

+ 7
- 5
site/public/titles.php View File

@@ -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>

Loading…
Cancel
Save