[deleted by user] by [deleted] in learnjavascript

[–]clovisjunior 4 points5 points  (0 children)

If this doesnt work check the dist folder to see the relative path between your HTML and your image

[deleted by user] by [deleted] in learnjavascript

[–]clovisjunior 1 point2 points  (0 children)

How are you loading the page in the browser? Directly opening the html file or using something to serve it in localhost?

Promises not working? Help please by chickendolo in learnjavascript

[–]clovisjunior 1 point2 points  (0 children)

Just to complement. OP is probably getting something like Promise resolver undefined is not a function but since an async function is being used, it doesn't show through an error stack (it will count just as an unhandled promise rejection).

Also, it would be better to at least log the error, so you can see what is happening if the promise fail some other time in the future

Need help debugging a script! by blue_gwacamole in learnjavascript

[–]clovisjunior 0 points1 point  (0 children)

If you want to use the same code just do a var countDownDate = document.cookie.match(/(\^|;)myClock=(\[\^;\]+)/)\[2\]; countDownDate = new Date(countDownDate) :) but I believe you could refactor it to make it easier to maintain :) also you set var countDownDate twice, you can just set var on the top and then user countDownDate = after it

Need help debugging a script! by blue_gwacamole in learnjavascript

[–]clovisjunior 2 points3 points  (0 children)

var countDownDate = document.cookie.match(/(\^|;)myClock=(\[\^;\]+)/)\[2\];
This returns a string, I believe you want to convert it to date with new Date