Jump to content

L8V2L

Members
  • Posts

    788
  • Joined

  • Last visited

Posts posted by L8V2L

  1. Javascript is a glue. It's becoming more popular as more than just a browser scripting language but it's always been a glue. You can't JUST lean javascript and do everything you want to do. Learn it along-side your server language (###### if it's nodejs more power to you) and your client language (probably html). But in technology there isn't just one language. You'l end up learning many languages to accomplish your goals.

    What do you mean in this --> (###### if it's nodejs more power to you), with the ######... Might be a curse word... The s curse word...Oh, I know... there is many different(I like to call them, programming interface language since they are like... a form for people who want to program... but not... binary programming...)programming language out there, from the beginning I was thinking of learning PHP with JavaScript, like that was the plan... but then I became a little more knowledge of the language, and the wizardry world of programming... I still might, but there are other programming language, that can act as an api for JavaScript!!! So I might head in that route.What is a node(I ask such question for more clarity. Everything by W3C standard is consider a node; node element, node attribute, node value, node text, etc)... What is a node?As I walk away with eyes full of rages, speaking under my breath...Me: JavaScript is more than a glue.Cut to black screenMe: I'll show you, I'll show you all.
  2. <!DOCTYPE html><html><body><h1 id="intro">My First Page</h1><p id="demo">Hello World!</p><script>var myText = document.getElementById("intro").childNodes[0].nodeValue;var innerhtml = childNodes[0].nodeValue;//<--How to make thisdocument.getElementById("demo").innerhtml = myText;//<--work?</script></body></html>
  3. for (i = 4; i <= 6; i++)

    I UNDERSTAND!!! After reading what you type up(which I do extremely appreciate you taking the time to bye the way) I look at the code to actually look at it for a second, and it came to me as, I put i in the demo1, and the number that is i will correspond with the placement of that p element tag!!!!! So simple put:
    <!DOCTYPE html><html><body><h1>My First JavaScript</h1><p>JavaScript can change the content of an HTML element:</p><button type="button" onclick="myFunction()">Click Me!</button><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><script>function myFunction() {var demo1 = document.getElementsByClassName("demo1")for(i = 4; i <= 6; i++){demo1[i].innerHTML="Hello World!";}}/*This had a little something to do with it to in passing that is:for (var i = 0; i < 9; i++) {   n += i;   myfunc(n);}*//*Me: JavaScript... JavaScript: Yes, my child?Me: There so much to learn.JavaScript: There is my son there is.Me: But the more I learn... the more I see I can do... the more powerful I become.JavaScript: Yes, as it is natural to happen, it is the order of nature.Me: ... I want to learn more, I want to learn more JavaScript.JavaScript: then go search my son... you remind me so much of my son child.Me: Really?!JavaScript: Yes, his name is Luke, like him, the force is strong with in you.Me: Wow!JavaScript: Now go young one, and let the force consume you.Me: YES JAVASCRIPT! I will!*/ </script></body></html>
  4. Let me give you a piece of advice. You like to scream in all caps about how you want more online documentation and guides. You say that you have already read a lot of online documentation and guides. You obviously don't understand very well how this stuff works, so I would suggest that the online documentation and guides are not working for you nearly as well as you think they are. I would suggest it is time for a book that contains exercises that you can practice with. What you are doing now is not working well, you should change it up. Something like MDN is not there to teach people how to write Javascript, it is a reference for people who already know Javascript where they can look up the details about how to use a specific thing. I do not consider that a learning resource, it is documentation for existing developers. Documentation isn't there to teach you how to program, it is only a reference. Look at the reference for a for loop, for example:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/forThat is not teaching you what a for loop is, why you might want to use it, where to use a for loop instead of a while loop, do loop, etc, any of that. It is not teaching theory, it is describing how to use it. The intended audience for that is not someone who doesn't know how to program, it is someone who is familiar with looping in other languages and wants to know how to do it in Javascript.An analogy is a dictionary. The purpose of an English dictionary is not to teach people how to speak English, it is a reference for existing English speakers to look up words they don't know. That's what documentation is. If someone wants to learn how to speak English, they take classes.Pay attention to the quote in my signature from the man who invented C++: He is the computer science chair at Texas A&M University. You can go there and learn directly from someone who created one of the most commonly used languages today. If you don't want to take our advice, take his - online documentation is shallow.

    .... WOW! That always been there? That's like a laugh in my face... that is, that it always been there...... What book should I read, their so many books, and the author love to talk side stuff a lot, and not just straight (here, this is that, and that is this, and this would be desirable to be use as that, and so on.)
  5. =js:0]<!DOCTYPE html><html><body><p>Finding the largest number.</p><p id="demo"></p><script>function findMax() {  var max = 0;  for(var i = 0; i < arguments.length; i++) {    if (arguments[i] > max) max = arguments[i];/*are you telling me, because this is a number, every time i increment, it's going to increment to the highest integer in the arguments object length property?... I hate that I have to ask this, I just want to be able to look at it, and understand it... (GIVE ME DOCUMENT, GUIDE, MANUEL YOU DAM DIRTY APES!!!!!)<~~~~ignore this.*/  }  return max;} document.getElementById("demo").innerHTML = findMax(4,56,6);</script></body></html>
  6. If you want to loop over 4 to 6, then loop over 4 to 6. That is far less confusing than looping from 4 to length - 15. If I saw that code I would be wondering what the significance of 15 is, why 15? If you want 4 through 6 then just do 4 through 6. You can also access each element individually without a loop.Look at the Wikipedia article. Pay attention to the difference between pre and post increment. After that for loop ends, what will the values of i and e be?

    Huh? How do I just go with 4 through 6? That code I present to you is the way I can only see how to do it. If you could show me what you mean...
  7. <!DOCTYPE html><html><body><p>Click the button to loop through a block of code five times.</p><button onclick="myFunction()">Try it</button><p id="demo"></p>/*result:The number is 0The number is 0 <-- This should not be zero... a least to my logic.The number is 1The number is 2The number is 3The number is 4*/<script>function myFunction() {    var text = "";    for (var i = 0, e = 0; i < 5; i=e++) {    //i is zero, then, it should be one next time around.        text += "The number is " + i + "<br>";    }    document.getElementById("demo").innerHTML = text;}//i is 0, (i = e++) == (0 == 0),eval(i = e++); i = 0, e = 1; i = 1, e = 2; </script></body></html>
  8. You're building a test case, and you decide to lay down twenty-something elements and then loop from 2 to length minus 18? How about a sane test? How about looping through all of them and seeing if that works? You can also target a specific element as long as it is within the length.

    I did loop through all of them. The reason why it's like that is cause I was trying to figure out, how I can select a group of them in the middle.How do you select a group of them from one integer point to another. for example: 4-6.
  9. Guys, look; JavaScript:

    <!DOCTYPE html><html><body><h1 class = "JS"></h1><p id="demo"></p><script>var person = {    firstName : "John",    lastName  : "Doe",    age       : 50,    eyeColor  : "blue"};var person1 = {    fN:"Hello",    lN:"JavaScript",    lU:"❤"};person1.prototype = person;document.getElementById("demo").innerHTML =person1.prototype.firstName + " is " + person1.prototype.age + " years old.";var JS = document.getElementsByClassName("JS");JS[0].innerHTML=person1.fN + " " + person1.lN + " " + person1.lU; </script></body></html>
    THE POWER!!!!!!
  10. Well, try them out and see.

    <!DOCTYPE html><html><body><h1>My First JavaScript</h1><p>JavaScript can change the content of an HTML element:</p><button type="button" onclick="myFunction()">Click Me!</button><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><p class="demo1">This is a demonstration.</p><script>//WHY WANT THIS WORK?!function myFunction() {var demo1 = document.getElementsByClassName("demo1")for(var i = 2; i < demo1.length - 18; i++){demo1[i].innerHTML="Hello World!";}//demo1[0, 1, 2].innerHTML = "Hello JavaScript!";/*This will not work, it'll only change the third element in the array. Is there another way I can do this with out using array method?*/}</script></body></html>
  11. getElementsByClassNameThat does not return a single element, it returns a collection of 0 or more elements.

    I was wondering about you! You been gone! Hope everything is alright with, and for you.... So, I would have to use
    for(var i = 0; i < demo1.length; i++){demo[i].innerHTML="Hello World!";}
    . Is this correct? Or would I have to do more, assuming that their only one element, and with a class name that no other elements have even if there was other elements... Could I also do it like this?
    demo[0].innerHTML=("Hello World!");
    . Is this, or and both of these correct?IT WORK!!!! THANK YOU JUSTSOMEGUY!!!!Would the first one work!?THE FIRST ONE WORK TOO!!! THANK YOU JUSTSOMEGUY!!!!!
  12. <!DOCTYPE html><html><body><h1>My First JavaScript</h1><p>JavaScript can change the content of an HTML element:</p><button type="button" onclick="myFunction()">Click Me!</button><p class="demo1">This is a demonstration.</p><script>//WHY WANT THIS WORK?!function myFunction() {     document.getElementsByClassName("demo1").innerHTML = "Hello JavaScript!";}</script></body></html>
  13. its because myD.style.backgroundColor == "", not "coral". Console.dir is your friend Javascript doesn't automatically populate the current computed CSS for any element, unless it made the change in the 1st place. You'd have to use window.getComputedStyle(myD) for it to load the current backgroundColor from that internal CSS. Even then it wouldn't always say "coral". Depending on the Browser it may decide to convert it to an rgb function like "rgb(255, 127, 80)". Often its much less of a headache to simply make an extra CSS class and use javascript to change the classes an element has, rather than manually changing every single style in each element. its also much more cross-browser friendly.

    What do you mean?
  14. The reason your code doesn't work is that the background color is never being set to "lightblue"

    That is the editing look, if you notice, I comment out the correct way when I went on a tempter on fingering out why it won't work...So my question still stand: WHY WON'T IT WORK!
  15. WHY WON'T IT WORK! I hate to come here and ask this, I was going over the css3 new modules for background-Color, but with in JavaScript syntax backgroundColor, and came to try to make a toggle with it. but it want work for some reason, and it should! I feel lower than a novice to have to come here to ask this simplicity question.

    <!DOCTYPE html><html><head><style>#myDIV{width:300px;height:300px;background-color:coral;color:white;}</style></head><body><p>Click the "Try it" button to set the background-color property of the DIV element to "lightblue":</p><button onclick="myFunction()">Try it</button><div id="myDIV"><h1>Hello</h1></div><script>var myD = document.getElementById("myDIV");function myFunction(){/*if(myD.style.backgroundColor == "coral"){myD.style.backgroundColor = "lightblue";}*/if(myD.style.backgroundColor == "lightblue"){ myD.style.backgroundColor = "pink";}else{myD.style.backgroundColor = "blue";}}</script></body></html>
  16. It seems like there's absolutely no place that gives knowledge in the way you would like it. You're at a point where you should try to adapt yourself to the information available rather than expect the world to adapt itself to you.

    I'll like to say thanks to all of you for... I guess putting up with me... to a sense I know this is ridicules, but I can't be no other person then myself... I tried. You can't hide who you are. Thank you all for putting up with my questions.
  17. I skim through it, and it just... I would rather read a tutorial, or a manual, documentation, guide that lay it out, and give no more information then what is the discuss topic. These books... I know they have knowledge in them... but.... I can't receive that knowledge by the way they are delivering to me. If you have any online read or anything.
×
×
  • Create New...