Jump to content

webmanz

Member
  • Posts

    71
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by webmanz

  1. 21 hours ago, administrator said:

    No.

    DOM is a map of the document (web page) represented in a series of programmatic objects. DOM is short for: Document Object Model

    ... You could replace the word 'model' for map. 

    So we have a bunch of JavaScript objects (as in object oriented programming) that allow you to access and manipulate/change things in the web page. 

    Makes sense?

    Yes makes better sense now.

    I mistakenly thought Javascript was a functional programming language, thanks for clarifying.

    • Like 1
  2. On 3/22/2018 at 8:12 PM, administrator said:

    They have no name, but can have arguments. 

    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.

  3. 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.

  4. 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.

  5. 8 hours ago, administrator said:

    Alert and prompt are methods built into JS.

    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'?

  6. 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?

  7. 15 hours ago, administrator said:

    Event handlers can be trapped for in or outside of functions.

     

     

    On 3/24/2018 at 11:11 AM, webmanz said:

    Can we say an event handler is always or solely used in function within function scenario's?

     

    By your reply you mean this is not true?

  8. 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.

  9. 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.

  10. On 3/14/2018 at 3:05 PM, mgreer58 said:

    Stef,

    Like you say, once you learn the fundamentals of one programming language, it usually shares so much in common, at its core, with all the other languages, functions, loops, selection, declaring variables, samo-samo.

    If you know of a good, helpful, C++ programmer, please let me know.

    -Mike

    Will knowing JS which is a functional programming language make it easier to learn C++  (object programming language)?

    I would like to learn C++ thru video as well.

  11. 1. I was wondering why alert argument has only one apostrophe and console log has two in this example below? 

    2. Can we say the console log has an argument too?

    document.getElementById("secondP").onmouseover=function(){alert('Mouse over second P');
    console.log("Log the anonymous Inner function on secondP")

  12. Re Event Handlers part 2 from Chapter 2

     

    The only consol error I couldn't replicate as per the video was the hover. In the video the consol log error appears as:

    Something happened: 2nd p tag moused-over

    Instead I get on Sublime text Firefox:

    SyntaxError: identifier starts immediately after numeric literal 

     

    My code looks like this:

    <!DOCTYPE html>
    <html onkeypress="sniffer('You pressed a key!')">
    <head>

          <meta charset="UTF-8">
          <title> Ch2 Javscript</title>
        <script>
            function sniffer(message) {
                console.log("Something happened: "+ message);
            }

        </script>

        <style type="text/css">
            #secondP {width: 200px; background-color: #AFE6A5}
            p:hover, button:hover {cursor: pointer;}
    </style>

    </head>
    <body onresize="sniffer('window resized')" onload="alert('page loading')">

        <h1>Welcome Uber Nerdling!</h1>

        <button id="butt"  type="button" onlcick="sniffer('Try it button clicked')">Try it</button>

        <p onclick="sniffer('p tage clicked')">&Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quaerat neque quo inventore ipsam, eveniet obcaecati et possimus, quas sed dolores autem delectus expedita! Quis amet alias accusantium at debitis, tempora.</p>

        <p onmouseover="sniffer(2nd p tag moused-over')" id="secondP">&Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus quod, voluptate dolor adipisci officia consequatur blanditiis nobis voluptatibus magni ipsum. Perspiciatis, autem? Suscipit quasi nam odio blanditiis, harum voluptate quidem.</p>
     

     

  13. Re LESSON 1: Event Handlers - part 1

    You have two sets of <script> on the same document, is there a reason for that or is it an error or are you allowed to do that?

    at 3 min mark (bottom of document) and then compare to 3.25 min (top of document)

     

    Update: problem solved.  In lesson 6 there was additional code not visible in lesson 1

    • Like 1
×
×
  • Create New...