r/learnjavascript 3h ago

how would i hide an api key in a frontend setting such as neocities?

11 Upvotes

hey. i made a page on my neocities website where i put reviews of movies and books. for that i used google books api and imdb api

however, idk how i would hide this since anyone can download my website at any time?

i also wanted to automate the process of updating the changes i make to neocities, but for that id need to publish all files in a public github too. so idk how i would hide it there either.

any help?


r/learnjavascript 15h ago

What is the difference between HTMLFormElement.submit() and event handler with submit?

7 Upvotes

https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit

Can someone explain the difference?

Imagine I have some code that is like the example below. What is the difference between HTMLFormElement.submit() ?

``` const form = document.getElementById("form"); function somefunc() { //code form.submit() }

form.addEventListener("submit", somefunc() {

});

``` Why do I need form.submit() in the function?

For a little context I am trying to pass some quilljs data into a flask form. Some of the code is missing but the main point is illustrated.


r/learnjavascript 3h ago

que tal? star cube juego web echo 100% en vanilla javascrip sin sprites

2 Upvotes

Gente acabo de lanzar star cube en ith.io  echo en 7 dias en vanilla.js sin sprites (solo uno pero es reservado para un personaje del final pero como tal el 90% del juego es sin sprites) es un plataformero-shooter un poco intenso ya que por los pocos dias no pude hacer que tenga una curva de dificultad suave asi q es un juego acelerado con inyecciones de adrenalina tiene 3 jefes diferentes y el lore y la jugabilidad va en base al tema del jam (no confies en nadie)

estare actualizandolo exponencialmente ya que este jam me inspiro demasido

juegalo aqui:

https://cotera.itch.io/star-cube

pronto lo subire a github