Jump to content

c0d0ps

Member
  • Posts

    1,640
  • Joined

  • Last visited

Everything posted by c0d0ps

  1. The exercise was to use a switch statement not if else statements but yes I am more comfortable with if else statements from my high school days. I am still new to the whole switch thing. This exercise is part of the mozilla course of javascript called conditionals 3 I think you missed the part where I added break; but yes it was needed. The code wasn't read properly by the computer without it. I will try to remember that. I appreciate pedantics as much as anyone (even if I don't know much about programming) but I think you're exaggerating about the whole abusing. Coding in bliss is not abuse it is me taking the stairs and falling down and hurting my ankles. Not worse than that.
  2. Thank you that worked great, except for machineActive = false I get this error code, = true still works like it should though and I don't know why Summarizing: For this specific exercise it is better to define response because of the pre stated paragraph.
  3. Hi thanks for answer, as noted in my (second) previous comment even on machineActive=true it shows Your Score is 75 and not the console log for case score >= 70 && score < 89: console.log("That's a great score, you really know your stuff."); break; screenshot
  4. Thank you This is the code after fixing the no break problems and exchanging response to console.log(); Only problem is nothing shows up besides "Your score is 75."
  5. So this is what I came up with thanks to the stack overflow linked above. Unfortunately it says "machine is not on" even when change let machineActive = false; to true
  6. Conditionals 3 Conditionals 2 Update: TLDR the goal is to convert if else statements to a switch version of the statement (like noted in my under "JavaScript" headline). Not necessarily using an if else statement (which I tried to do) in a switch statement. I will work on better placing though thank you.
  7. Test your skills: Conditionals - Learn web development | MDN (mozilla.org) I am doing the mozilla online course - javascript exercise
  8. Hi I'm using a .html and .js file Languages: HTML, CSS, JavaScript Level: Beginner Problem: I'm guessing switch statements don't work with if else statements? Updated to bring more clarity To underline the point of the exercise here: the goal is to convert if else statements to a switch version of the statement (like noted in my under "JavaScript" headline). Not necessarily using an if else statement (which I tried to do) in a switch statement. JavaScript See updated code further down if-else Code from last exercise that i'm converting to a switch statement Updated code:
  9. Hi I forgot to everything under var newStory = storyText; var xItem = randomValueFromArray(insertX); var yItem = randomValueFromArray(insertY); var zItem = randomValueFromArray(insertZ); when I updated my comment I managed to fix it, thank you
  10. Hi I'm using a .html and .js file Languages: HTML, CSS, JavaScript Level: Beginner Problem: Unable to loop through JavaScript program more than once (aka change custom name a second time or changing from us to uk) I managed to fix all my problems to get the program to work but I do not know why it only works one time.. Short info about the program: It generates a short story where Bob is replaced by your custom name and it can translate fahrenheit and pounds to celsius and kg If you would like to make this program yourself just google Mozilla Javascript (the course) silly story generator (the assignment to test your beginner skills) or something similar. Html CSS JavaScript
  11. Update: I removed the calling and then I got stuck on what to do next. How do use input type="button" in javascript? is it like Or something else? the Mozilla website didn't show an example of how to do this. JavaScript HTML <input type="reset" value="Börja Om" onclick="Reset()"> I will be done with CSS soon then I can learn more about JavaScript which seems to be the most fun part about building a website..
  12. Its the code below correct? HTML <input type="reset" value="Börja Om" onclick="Reset()"> JavaScript
  13. Update: I realized that the reset button doesn't include my datecontrol.value = 07:00, what can I do about that? I'm guessing I would need to customize the reset button through javascript?
  14. Thanks for response. How do I force it to show " 07:00:-- "? (e.g. minimum time as placeholder for both startwork and endwork)
  15. Hiya again, I changed minimum time from 10 to 07 and max time from 15 to 18 and then my placeholder disappeared. I am not sure why the placeholder disappeared when all I did was change the time to 3h earlier..? Example of problem - " should be month/day/year 07:-- " JavaScript - Changed min and max on both when I start and end work HTML
  16. Hi I'm using a .html file Languages: HTML, CSS Level: Beginner Problem: Unable to mask img_5terre.jpg as a layer inside w3logo.png HTML CSS Wrong Correct - example
  17. I actually just found this out. Thanks, this works great - It also works with ID! CSS
  18. Hi, thanks for answer. This did not work. HTML CSS Fail.jpg I'll try to use datalist id instead I suppose.
  19. Hi I'm using a .html file Languages: HTML, CSS Level: Beginner Problem: Trying to style my dropdown-form yellow aka same as password Problem.jpg Correct.jpg HTML CSS
  20. Any updates? What did you do to fix the problem?
  21. That fixed it thank you. all.js seemed to have the right code. I'll remember to ignore crosssorigin for local files vs remote files.
  22. External Javascript HTML Screenshot of other JavaScript files available in the zip file: Should I do something more? Thanks for reply.
×