but i dont think those would set the size of the element
just the size of the background image
so some would get cut off if the element isnt big enough
@g4m3rm1k3 scripts go in between the <body></body> tags of your html
also, don't call a function during the on focus event, especially an alert, you create an infinite loop because the element stays focused and alert pauses any functionality
everytime the alert is closed it is just opened again because the on focus event fires the function with alert again
scripts dont have to go in the body tags
@zippkidd Thanks I think he got it in the video he just stopped the page from sending messages so thats a little frustrating but I am learning so whatever
g4m3rm1k3 sends brownie points to @zippkidd :sparkles: :thumbsup: :sparkles:
@moT01 but they probably should. from stack overflow: "The problem with writing scripts at the head of a page is blocking. The browser must stop processing the page until the script is download, parsed and executed. The reason for this is pretty clear, these scripts might insert more into the page changing the result of the rendering, they also may remove things that dont need to be rendered, etc. "
@g4m3rm1k3 you're doing fine. The important thing is you're learning! Good for you!
what happens if you want a script loaded before the rest of the stuff
is there like an onload function?
@moT01 in that case you load in the script at that specific point, and no sooner. Obviously this is a flexible rule and if there is a case where you need to load the script before the </body> then you would do that
It's just generally considered good practice to load mostly all scripts right before </body>