This zone is sleeping right now! ZzzZZzzz

Better not disturb it! ~You go to the petrol station and buy a slushy instead, everything is cool!~

This area will open again in 000.beats!

(Learn about Swatch Time)

Some other zones are awake :^]


Artifacts Gallery Guilds Search Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining?
Autumn, 28 Sep 2026 - @181.76
Forum Activity: Three Stars Random | Recent Posts | Guild Recents
News: Love is not possession  :4u: Guild Events: TIME FOR HALLOWEEN CRAFTS!
Super News: ~~MelonLand's Halloween Profile Design Contest 2026~~
+  MelonLand Forum
|-+  Da Web Revival
| |-+  ✁ ∙ Web Crafting
| | |-+  ☔︎ ∙ I need Help!
| | | |-+  Help with Swatch Clock


« previous next »
Pages: [1] Print Embed
Author Topic: Help with Swatch Clock  (Read 1036 times)
Ajsiets
Newbie ⚓︎
*
View Profile WWW


⛺︎ My Room

Artifacts:
Joined 2024!
« on: Summer, 04 Aug 2024 @194 » Toggle Font Embed

Hi! I've wanted to experiment with integrating JavaScript with a website, and I thought a simple project would be adding a swatch clock, but for some reason it doesn't seem to work? I copied the code from Melon's post about swatch clocks, and followed the instructions as best as I know how to, but it just displays "@000" which I have in there as static default text that's supposed to be replaced by the clock itself. I've attached some screenshots of the code if anyone can help me find what I might be missing? I've included the JavaScript file, as well as the span that holds the clock, and the script tag where I've linked the .js file. Thank you very much!

https://github.com/ajsiets/ajsiets.github.io/blob/main/Code.PNG?raw=true
https://github.com/ajsiets/ajsiets.github.io/blob/main/Script.PNG?raw=true
https://github.com/ajsiets/ajsiets.github.io/blob/main/Span.PNG?raw=true

Logged
Memory
Guest

« Reply #1 on: Summer, 04 Aug 2024 @414 » Embed

[removed by author]

« Last Edit: Summer, 07 Aug 2024 @476 by Memory » Logged
rhenn
Jr. Member ⚓︎
**
View Profile WWW


⛺︎ My Room
StatusCafe: rhenn

Artifacts:
Joined 2024!
« Reply #2 on: Summer, 04 Aug 2024 @533 » Embed

J makes some good points!

I'd also recommend using the defer keyword when running scripts on your site, it makes sure that the script doesn't run until all of your html is loaded. If you have your script in the <head> of your html, functions like document.getElementById can break because the elements they're looking for haven't loaded yet.

Code
<script defer src="/script.js">

Logged

https://f2.toyhou.se/file/f2-toyhou-se/images/77020746_kuzVGSABhs21uUT.png
Pages: [1] Print Embed 
« previous next »
 

Melonking.Net © Always and ever was! SMF 2.0.19 | SMF © 2021 | Privacy Notice | Send Feedback | Supporters ♥ Forum Guide | Rules | RSS | WAP | Mobile


MelonLand Badges and Other Melon Sites!

MelonLand Project! Visit the MelonLand Forum! Support the Forum
Visit Melonking.Net! Visit the Gif Gallery! Pixel Sea TamaNOTchi
@000 Melon
Land
Forum Art Hub Chat Webring Enter Random Recent Tenement Arcade Want to Login or Join ? Web Craft Guide Graphic Catalogue Wiki Help I'm Lost! Link Land Newsletters Image Stream Minecraft: Online
Zap!
Passport Sites tamaNOTchi Asatte Add your site?
Aero Archive Onio Cafe 32 Bit Cafe Status Cafe