Home Events! Entrance Everyone Wiki Search Login Register

Welcome, Guest. Please login or register. - Thinking of joining the forum??
September 21, 2024 - @183.73 (what is this?)
Forum activity rating: Three Stars Posts: 39/1k.beats Unread Topics | Unread Replies | Own Posts | Own Topics | Random Topic | Recent Posts
News: :ha: :pc: Hello Melonland! :pc: :happy:

+  MelonLand Forum
|-+  World Wild Web
| |-+  ✁ ∙ Web Crafting
| | |-+  ☔︎ ∙ I need Help!
| | | |-+  Help with Swatch Clock


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


⛺︎ My Room

View Profile WWW

Joined 2024!
« on: August 04, 2024 @193.69 »

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!




Logged
Memory
Guest
« Reply #1 on: August 04, 2024 @413.72 »

[removed by author]
« Last Edit: August 07, 2024 @475.58 by j » Logged
rhenn
Casual Poster ⚓︎
*


⛺︎ My Room
StatusCafe: rhenn

View Profile WWW

Joined 2024!
« Reply #2 on: August 04, 2024 @532.65 »

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

Pages: [1] Print 
« previous next »
 

Vaguely similar topics! (3)

Swatch Internet Time (@Beats)

Started by Cobra!Board ☞ ∙ Life on the Web

Replies: 30
Views: 3140
Last post March 02, 2024 @198.43
by Yaya
What helped you code html/css easy?

Started by LIABoard ✁ ∙ Web Crafting

Replies: 17
Views: 2036
Last post October 11, 2023 @152.56
by flowers
Melons critiquing and helping each other

Started by urgellxBoard ✎ ∙ Art Crafting

Replies: 22
Views: 1784
Last post August 24, 2024 @487.13
by e-

Melonking.Net © Always and ever was! SMF 2.0.19 | SMF © 2021, Simple Machines | Terms and Policies Forum Guide | Rules | RSS | WAP2


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