webmanz
-
Posts
71 -
Joined
-
Last visited
-
Days Won
2
Content Type
Profiles
Forums
Events
Downloads
Gallery
Store
Posts posted by webmanz
-
-
Are there only 4 types of loops in js? Are there more?
while, do/while, for, for/in
-
Do "if else" conditional statements only ever appear together? Can you have an 'else' without an 'if and vice versa?
-
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.
- 1
-
Can we label DOM as a JIT complier?
-
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.
-
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.
-
1 hour ago, administrator said:
Hmm ... it has been a while since I looked at this code. Did it resolve itself in the subsequent videos?
Stef
Yes got resolved in subsequent videos. Thanks
- 1
-
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.
-
Should we use camel case when naming js external files?
example: spaceinvaders.js
versus
spaceInvaders.js
Which one is best practice?
-
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'?
-
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?
-
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?
-
14 hours ago, administrator said:
What do you mean by 'high order' function?
By this I mean a function that can return a function as its output. What is the correct term to describe such a thing?
-
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.
-
12 hours ago, administrator said:
What do you mean by 'high order' function?
Ignore that. Thanks for reply
-
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.
-
Can we say an event handler is always or solely used in function within function scenario's?
Or within high order function scenario's?
-
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.
-
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?
-
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") -
Can we say anonymous functions have no name and no argument as well ?
-
On 3/19/2018 at 6:22 PM, administrator said:
.... Just glancing over your code, did you notice the missing single quote?
onmouseover="sniffer(2nd p tag moused-over')"
.. should be:
onmouseover="sniffer('2nd p tag moused-over')"
That solved it Stef thanks
-
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>
-
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
- 1
Are there only 4 types of loops in js?
in Javascript
Posted · Edited by webmanz
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.