Skip to content

Commit 92c3a11

Browse files
simonwclaude
andauthored
Fetch default content when no URL hash is present (#242)
When animated-word-cloud.html loads without a hash fragment, fetch the README.md from simonw/research rust-wordcloud and populate the textarea with it, without auto-submitting. https://claude.ai/code/session_01Cd6Lisz22DQh4z4iNmmYpU Co-authored-by: Claude <noreply@anthropic.com>
1 parent f9f02cc commit 92c3a11

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

animated-word-cloud.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,11 @@ <h1>Animated Word Cloud</h1>
620620
if (hashText) {
621621
textInput.value = hashText;
622622
generate(hashText);
623+
} else {
624+
fetch('https://raw.githubusercontent.com/simonw/research/refs/heads/main/rust-wordcloud/README.md')
625+
.then(r => r.text())
626+
.then(text => { textInput.value = text; })
627+
.catch(() => {});
623628
}
624629
})();
625630
</script>

0 commit comments

Comments
 (0)