-
Posts
788 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by L8V2L
-
-
<!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>
-
<p>Look what I found on O'Reilly. I might read it after I get done finishing the documents, manuals, and guides I put in plans to read.</p><image src="http://akamaicovers.oreilly.com/images/9780470611944/lrg.jpg">
-
What is node.js?
-
I've already suggested several books to you. Look in your old threads. I'm not here to do research for you, if you want to know what the most respected books about Javascript are then do the research yourself.
-
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:for (i = 4; i <= 6; i++)
<!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>
-
.... 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.)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.
-
=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>
-
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...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?
-
No reason, I was studying, and went in depth on what I though was, but isn't.
-
<!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>
-
Then the code will have to befor (i = 4; i <= 6; i++)
for(var i = 4; i < demo1.length-15; 1++){demo1[i].innerHTML="Hello World!";}//assuming there are only 21 p elements/nodes.
-
How to use the keyword "this" correctly to target? In your own words please.
-
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.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.
-
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!!!!!! -
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>
-
I was wondering about you! You been gone! Hope everything is alright with, and for you.... So, I would have to usegetElementsByClassNameThat does not return a single element, it returns a collection of 0 or more elements.
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!!!!! -
<!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>
-
What do you mean?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.
-
IT WAS A FEAKING MISTYPE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! STUPID NOVICE ME!!!
-
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!The reason your code doesn't work is that the background color is never being set to "lightblue"
-
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>
-
That's to much for my novice mind to grasp yet... I been look at the source from when you first post this, I don't know what happen to me from replying back to you.just look at the source, yeeshhttp://jquery.com/
-
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.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 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.There are entire books devoted to working with Canvas. http://www.amazon.com/Core-HTML5-Canvas-Animation-Development/dp/0132761610/ref=sr_1_2?ie=UTF8&qid=1400724207&sr=8-2&keywords=canvas+html5
L8V2L thoughts on JavaScript...
in JavaScript
Posted · Edited by L8V2L