Jump to content
Killersites Community

webmanz

Member
  • Content count

    54
  • Joined

  • Last visited

Everything posted by webmanz

  1. Are all objects data types or only array objects?
  2. Can someone tell me why my code didn't produce the same results as in Chapter 7 lesson 4. I only managed to get Loop Count: 10 to appear, I'm not able to get Loop Count: 0 to 9. <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> Ch7 Javscript Loops</title> <script> function doItAgain(message){ for (var i=10; i>=0; i--) { var target = document.getElementById("target"); target.innerHTML = "LoopCount:" + i + "<br>" + target.innerHTML; cosole.log("LoopCount is now: " + i); } console.log ("End for loop"); var button = document.getElementById("looper"); button.value="Done looping!"; //button.style.fontSize="34px"; } </script> </head> <body> <h1>Looping can make your code spin!</h1> <input type="button" id="looper" value="Do it again!"> <p id="target"></p> <script> document.getElementById("looper").onclick=function(){ doItAgain(); this.style.color="red"; } </script> </body> </html>
  3. webmanz

    What does i stand for in i - - ?

    for ( var i = 10 ; i > = 10 ; i - - ) Why doesn't the i - - end in a semi-colon then parenthesis ? i.e. like this: i - - ; )
  4. What does the " i " stand for in i - - ? Special meaning? for ( var i = 10 ; i > 10 ; i - - ) and is the above same as saying: var i=10; i > 10; i = i - 1;
  5. webmanz

    Opinions To Dreamweaver

    Is Dreamweaver still relevant?
  6. webmanz

    Divi elementor beaver

    1. Can we say these Wordpress site builders appear to be analogous to Dreamweaver? 2. Who tends to gravitate towards Wordpress site builder's? 3. Are we taught about these site builders or Wordpress in Stef's courses?
  7. webmanz

    + target.innerHTML with loops

    3.52 minute mark of chapter 7 part 3 Loops Q1: Why does the + target.innerHTML added at the end (see code below) appear in ascending order on the web page rather than descending like it does in the console.log? I do realize that you can achieve descending result by adding + target.innerHTML in the front to match console.log but I'm curious why when added to the end it gives a ascending order rather than descending order? Here's the code from that lesson 3.52 minute mark of chapter 7 video part 3 Loops: function doItAgain(message){ var loopCount=5; while (loopCount > 0) { var target = document.getElementById("target"); target.innerHTML="LoopCount:" + loopCount + "<br> + target.innerHTML; <------------ referring to this line console.log("loopCount is now:" + loopCount); loopCount=loopCount -1; } console.log ("End loop"); var button= document.getElementById("looper"); button.value="Done looping!"; }
  8. webmanz

    What does i stand for in i - - ?

    Could we have used any letter besides "i" and still it work? example: for ( var t = 10 ; t > 10 ; t - - )
  9. webmanz

    Are there only 4 types of loops in js?

    Before posting I looked at w3schools found 4 same loops, I just thought there might be more, so for now I will conclude that's all the loops there is in JS.
  10. Are there only 4 types of loops in js? Are there more? while, do/while, for, for/in
  11. Do "if else" conditional statements only ever appear together? Can you have an 'else' without an 'if and vice versa?
  12. webmanz

    Can we say DOM is a JIT complier?

    Yes makes better sense now. I mistakenly thought Javascript was a functional programming language, thanks for clarifying.
  13. Can we label DOM as a JIT complier?
  14. webmanz

    Anonymous function

    This is an example of anonymous function with no name? function() The above appears to ask for a name in console log and appears as an error.
  15. webmanz

    Anonymous function

    Can we say anonymous functions have no name and no argument as well ?
  16. Chapter 5 lesson 5 5.37 minute mark of video alert("Alert: " + "stef@studioweb.com" . indexOf("@") For the above to work do I still need to type in code mentioning console log? In other words just that one line of code without any mention of console log or anything else? By anything else I mean: var email var theAt console.log In the video the js position shows up in console log using that one line of code.
  17. webmanz

    You didnt call sniffer in Chapter 5 part 2

    Yes got resolved in subsequent videos. Thanks
  18. Chapter 5 part 2 1.57 minute mark You said""When I click the button I am going to call sniffer..." The code looks like this in the video: document.getElementById("butt").onclick=function(){ sniffer("Clicked on secondP"); outSide(); If sniffer was called then in the video we would have seen an alert saying "Clicked on secondP". I also note that they was no actual second paragraph to click.
  19. Stef No definitive reason was given as to why its best practice to place getElementById at the bottom of document when used together with anonymous functions in lesson 6 chapter 2. Would anything be different if it was placed higher up in the document?
  20. webmanz

    error code colors different

    re chapter 3 lesson Javascript Errors From this: console.log("Something happened: " + message); } to this console.log("Something happened: + message); } Using Sublime the only thing that changed color for me when I removed quotes as per the video was + message, it changed color and there was a horizontal pink box stretching left to right on same code line just after + message had changed color. Unlike the video lesson the rest of my code didn't change color when I removed the quotes - they remained the same colors. Perhaps it's its something to do with my settings? Stef did mention you can adjust color error code within Sublime.
  21. webmanz

    sniffer

    example from chapter 2: function sniffer(message) Q: Is sniffer a made up word or does it have some special standing in JS with things like 'alert' and 'prompt'? Q: Are alert and prompt js keywords too?
  22. webmanz

    naming js external files

    Should we use camel case when naming js external files? example: spaceinvaders.js versus spaceInvaders.js Which one is best practice?
  23. webmanz

    sniffer

    1. We can't say they are keywords though, on par with function and var? 2. Can we say function and var are built in methods of JS too? 3. Are built in methods the same thing as a 'keyword'?
  24. Chapter 4 part 3 Question 2: Using only one statement, create a variable with the name of 'age' and give it a value of: 18 I answered var age="18" but the correct answer was var age= 18 Why my answer was incorrect as it did have the quotes in the right spot.
  25. webmanz

    function within function

    By your reply you mean this is not true?
×