• Donate and support Agora Road's Macintosh Cafe to keep the forum alive and make any necessary upgrades to have a more pleasant experience! Update: I configured the site with Brave Browser, so you can send tips to the site with BAT.

    - Upgrade now for donation only awards! In Three Tiers

    -- Agora Gold

    -- Agora Silver

    -- Agora Bronze

    Upgrades like "moods" username customization, profile customization, custom backgrounds, banners and much more!

    It will be under Account Upgrades

    Submissions for Tales of Agora Road Issue #4 is OPEN!

(Pretty beginner) html help

Chao Tse-Tung

Chairman of the Deep-State Cabal, KEC
Gold
Joined
Jan 1, 2022
Messages
279
Reaction score
997
Awards
103
Website
aoaed-official.neocities.org
So I'm gonna start working on my neocities again soon, and I want something that is (functionally) the same as the random agora quotes you get here.

Now, I'm not completely clueless, I can roughly imagine that there's some page containing a list of strings and then you somehow pull randomly from that list to put them on your visible page every time the page loads. Am I way off base? Regardless, guidance would be mighty helpful.
 
Virtual Cafe Awards

shinobu

Jack of all trades
Joined
Dec 17, 2021
Messages
320
Reaction score
2,166
Awards
173
95% sure it's some Javascript. edit: actually, it could be PHP, but you can't do it like that in neocities so what I wrote still is the way to do it in neocities

First you create a <div> or some other element in HTML, you give it an id like randomquote, and then in a <script> tag you define a list of quotes, select one at random and put it in the div's innerHTML
let quotes = ["quote a", "quote b", "quote c"]; let selectedQuote = quotes[Math.floor(Math.random()*1000) % quotes.length]; document.getElementById('randomquote').innerHTML = selectedQuote;
Something like this
 
Last edited:
Virtual Cafe Awards

0xpizzaface

Internet Refugee
Joined
Jun 13, 2022
Messages
14
Reaction score
15
Awards
5
this is excellent. a thing i didnt even realize i wanted and the way to go about accomplishing it. thank you both! :agpepsi:
 
Virtual Cafe Awards

Similar threads