Jump to content

L8V2L thoughts on JavaScript...


L8V2L

Recommended Posts

SVG is XML, so you can only modify it using XML DOM methods. As the property name indicates, innerHTML only manipulates HTML. I've worked with SVG using Javascript before, but not when it was embedded in HTML. Here's an example: https://dl.dropboxusercontent.com/u/27077732/svg3d/index.html

Link to comment
Share on other sites

Hmmm... apparently SVG doesn't like innerHTML. What do the SVG tutorials say?

Oh, ha, ha davej. funny.

SVG is XML, so you can only modify it using XML DOM methods. As the property name indicates, innerHTML only manipulates HTML. I've worked with SVG using Javascript before, but not when it was embedded in HTML. Here's an example: https://dl.dropboxusercontent.com/u/27077732/svg3d/index.html

I was planning on learning xml just out of respect for html, and SVG coding, but now I see it's a necessary.Thanks for the link! I want check out the xml right now, but after I get done going through JavaScript references. But I check out the dropbox one... It look smooth... it look really smooth... Why is that? Does not the SVG animation work as good as just manipulating the SVG code with JavaScript? Or better yet, it is in it's native environment, which is the xml file?And what about the Dom SVG objects, methods, and proprieties?(Can someone give me a brief description of these three, object, method, and property... I know them, but I want to make sure I know them... Please.) Like the SVGRect object? It say read only, does that mean I can't manipulate it? Edited by L8V2L
Link to comment
Share on other sites

Examplexmlhttp.open("GET","demo_get.asp",true);xmlhttp.send();Try it yourself »In the example above, you may get a cached result.To avoid this, add a unique ID to the URL:What do this mean; avoid a cached result?

Link to comment
Share on other sites

When you are asking about a specific tutorial it would be helpful to include a link to it...

 

http://www.w3schools.com/ajax/ajax_xmlhttprequest_send.asp

 

The browser caches pages, so it is possible that you might load a page and the browser actually just loads it from a local copy on your hard drive rather than going out to the website.

 

http://en.wikipedia.org/wiki/Web_cache

  • Like 1
Link to comment
Share on other sites

I'm on MDN's tutorial again, and trying a for loop in the console they show case as to evaluate into a 2deminional array. But when I long it into the console, an exception is thrown, stating:

Unable to get property '9' of undefined or null reference
Here is the for loop statement:
for (var i = 0, j = 9; i <= 9; i++, j--)  console.log("a[" + i + "][" + j + "]= " + a[i][j]);
Link to comment
Share on other sites

When you are asking about a specific tutorial it would be helpful to include a link to it... http://www.w3schools.com/ajax/ajax_xmlhttprequest_send.asp The browser caches pages, so it is possible that you might load a page and the browser actually just loads it from a local copy on your hard drive rather than going out to the website. http://en.wikipedia.org/wiki/Web_cache

Thank you.
Link to comment
Share on other sites

For example, if a is a 2-dimensional array with 10 elements on a side, the following code uses the comma operator to increment two variables at once. The code prints the values of the diagonal elements in the array: :( I don't want to be a hack... I want to know JavaScript.... I need to understand everything about it.I know what it is about documentation, manual, and guide; it's giving me the information what is JavaScript... lately it been hitting me on what I could use arrays for, and objects, and functions, epically oops programming. I want to know JavaScript... I understand you all have recommended books to me... but I can't read them, for it feel as if I'm not getting know where... I need a material that would feel as if it is worth reading, even if I don't get it the first time of the depth defined meaning, as long as it giving me something on the surface level too. I will go over it as many times as I need to also get the depth underneath the surface... I need to understand JavaScript. I need to know it. I need to.

Link to comment
Share on other sites

:( I don't want to be a hack... I want to know JavaScript.... I need to understand everything about it.

 

Then write more code, and when you have a problem show us all relevant parts of the code. In this situation you created an array and then you had trouble accessing the array -- so obviously you should show us the code that created the array -- as well as the code that was attempting to access the array.

  • Like 1
Link to comment
Share on other sites

Then write more code, and when you have a problem show us all relevant parts of the code. In this situation you created an array and then you had trouble accessing the array -- so obviously you should show us the code that created the array -- as well as the code that was attempting to access the array.

:) Thank you... I still want to work on my foundation of JavaScript, before I start writing my own code for my own application... As I go over JavaScript, it comes to me after ward the different components that can be utilize as are necessary... it almost as if I can see the source code in my head to what I need to do to make it come to part.I can see the power....Some where in the darkness of space JS_dark_vader is watching the young one develop into something.JavaScript: Soon, soon the young one will be ready to join me. Soon. Ha ha ha. Edited by L8V2L
Link to comment
Share on other sites

//HTML<canvas id="canvas" style="border:2px solid black;" width="200" height="200"></canvas>1//JavaScriptvar canvas = document.getElementById('canvas');var ctx    = canvas.getContext('2d');var data   = '<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200">' +               '<foreignObject width="100%" height="100%">' +                 '<div xmlns="http://www.w3.org/1999/xhtml" style="font-size:40px">' +                   '<em>I</em> like <span style="color:white; text-shadow:0 0 2px blue;">cheese</span>' +                 '</div>' +               '</foreignObject>' +             '</svg>';var DOMURL = window.URL || window.webkitURL || window;var img = new Image();var svg = new Blob([data], {type: 'image/svg+xml;charset=utf-8'});var url = DOMURL.createObjectURL(svg);img.onload = function () {  ctx.drawImage(img, 0, 0);  DOMURL.revokeObjectURL(url);}img.src = url;
This is appose to able one to draw/write to the canvas, but it is outdate and does not work. Could anyone see what is need to tweak it to get it back working?
Link to comment
Share on other sites

I would love to go through it, but not now, now I just want to concentrate on learning JavaScript, and making sure I understand everything.

Then why are you asking questions about node.js and canvas and SVG and Flash and everything else? And, when you do ask questions about Javascript, why are they the same entry-level novice questions that you've been asking this whole time? Are you really learning anything?

I still want to work on my foundation of JavaScript, before I start writing my own code for my own application.

The way people learn is by doing. Doing means writing code. You have the most hands-off approach to learning I've ever seen, you want to read only the most shallow things out there, avoid any book worth buying, and avoid doing any actual work. That is not learning. I don't know what that is, but it's not learning.

I understand you all have recommended books to me... but I can't read them, for it feel as if I'm not getting know where... I need a material that would feel as if it is worth reading

That's a joke. You don't want to get a book, because you don't feel like it's worth reading, but you'll read online tutorials. You won't buy a book that someone has taken months or years of their life to research and write, went through the trouble of publishing it, getting it distributed, and staking their name, professional reputation, and future income on. But you'll read a tutorial online that any idiot can write and publish in a day. It is no wonder that you still have no understanding of code. Everything that you have learned so far would have been covered in the first few chapters of a respectable book. You know, the kinds of books that all professional programmers everywhere read. The kind of books that you don't think are worth reading. One of those books on Amazon is ranked as the #1 most popular book in Javascript, and Programming, and Introductory & Beginning Programming. The #1 book in all of those categories. But you don't think it's worth reading, you think you would get more out of reading tutorials and documentation which is meant for people who already know how to program.Face it: not only do you have no idea how to program, but you also have no idea how to learn to program. You've got 7 pages of messages here telling you how, but you're ignoring those too. Maybe you think they're not worth reading.

I will go over it as many times as I need to also get the depth underneath the surface

The joke's on you kid, because everything you have been reading so far is all surface. It's all breadth, and no depth. That is pretty much the entire business model of W3Schools: provide short pages on as wide of a range of topics as possible, where every one does not go too in-depth.Anyway, this is why I'm not bothering to answer your questions any more. They're the same questions. You're not learning. You have all of these people who know way more than you do, and you're not taking anyone's advice. Go ahead, keep looking for tutorials to teach you everything, see how far that gets you. I'm going to spend my time and effort on people willing to do what it takes to learn.
  • Like 1
Link to comment
Share on other sites

I think about me, I am learning. This I feel is the best way, I already told you; I try reading book, even after what I read of what you type, I went to amazon two see, and pick to books, then I download them, and try to read them, and what you know, it was a lot of author input... Do you know what I want to read, I text book, I now see the value that text books hold, I see that it being plain text, with no humor, and only on the topic it is label to discuss; I see them as gold now. That why I like tutorial; cause with tutorial that keep on track with no side line shinicaioin...(don't know how to pronounce or it say it correctly enough to actually go and look it up.) not going off of topic. I want a text book! Please, if you know of a introduction book that give exactly that; straight to the point information. Stay on topic, not "When I was a child my father told me" bullstuff. I don't care nothing about that, really I'm not reading to learn anything about the author, I'm reading to learn about JS, and html, css. Then when they talk for a paragraph long, and get back on subject, then tell you to double back to reread a paragraph from the last page that they could have put in the spot of the paragraph of them self or what ever. I don't want to read something like that... when I read these tutorial, I do my best to read them straight through, I don't like it when I skip over a section. And that what I find myself doing in them books. I don't want that. I want to learn. Forget about the documentation, manual, and guide, give me a textbook to read! PLEASE!!! I would(and is plaining on reading it) the ecma-script documentation; but it is seem to be made for other programming, and I'm talking about wizard level programmer to understand.

Edited by L8V2L
Link to comment
Share on other sites

Book writers don't say random things for no reason. The book is designed with teaching in mind. Read it, read all of it. You might think some parts aren't relevant, but perhaps you just aren't educated enough to judge that.

 

Learning requires an effort from your part. We can point you to books, tutorials and documentations. We can point out and correct mistakes in your code, but we're unable to put knowledge into your head. You have to put your own effort into learning.

Link to comment
Share on other sites

Book writers don't say random things for no reason. The book is designed with teaching in mind. Read it, read all of it. You might think some parts aren't relevant, but perhaps you just aren't educated enough to judge that. Learning requires an effort from your part. We can point you to books, tutorials and documentations. We can point out and correct mistakes in your code, but we're unable to put knowledge into your head. You have to put your own effort into learning.

And I am, I have this site tutorial along with other sites tutorial a couple of time and even the reference area of this site and another site.I'm going back over the tutorial as we speak... I am non-stop reading, I do nothing but this. period, I want to know how to program so I can support myself, but even that, I see it as a tool to express myself... I always wanted to learn how to draw, but now I can see with this, I can do more then draw a straight line with canvas, or svg, I can do more. I want to know JavaScript, give me a text book, please you must no a book that just give you information cut bone and dry, I don't care about it being boring, there is no such thing if you are searching for knowledge, I literal can't set and read them book with out feeling a sense of wastefulness toward it, I know those book contain knowledge, and I other stand the author strategy on delivering that knowledge, to show that he to was ones like the reader, and or that showing his path of getting to where he is at can encourage the reading to continue onward. I understand that... but for me... I need to stay on track. Please give me a freaking textbook, I want something that's like a dull lesson on JavaScript that give you everything you will need to know, with no small talk in-between.... maybe a little small talk... Something like this site; I'm speaking on the structure. And don't think I'm not searching for new materials read, both books, and online, but online tutorials(so far just this, mdn, msdn, d...php, and even reference(not really, I just found one that seem to interest me, but I'm sticking to the plan I have, and so after I read mdn again, I'll see about reading through that)) I feel every time I go through them ones more with a little understand, more understand compile to it. Please I'm not asking you to point me to the best book, I want a textbook-like read. Thank you all for all you done for me, I do appreciate it. I appreciate you putting up with me. This the first time I been so open about (refer to pic). not many bother with me. One thing I learn living through this life is that you can't hide what is wrong with you.
Link to comment
Share on other sites

You're not wasting your time reading those books. You're wasting time when you're not reading them.

I don't know of any books that are written the way you describe, but there are resources like that: The W3Schools tutorials and the MDN Javascript guide, among other resources. They're straight to the point and don't have any "small talk" in them.

 

But you don't seem to be learning from those places either. The W3Schools tutorial should be more than enough to have a basic understanding of Javascript, something you clearly don't have yet.

Link to comment
Share on other sites

:) Thank you... I still want to work on my foundation of JavaScript, before I start writing my own code for my own application...

 

We don't expect or want you to write a large program, but you should be writing small programs. Write a simple game or a form with validation or something else that you might need later.

Link to comment
Share on other sites

I think about me, I am learning. This I feel is the best way, I already told you; I try reading book, even after what I read of what you type, I went to amazon two see, and pick to books, then I download them, and try to read them, and what you know, it was a lot of author input...

Which books exactly did you read then? I guarantee if you picked any of the books JSG has recommended to you, they wouldn't be like that. I have never found a professional book that didn't use personal experiences other than for educating and for imparting wisdom, which is just as important as learning a design pattern.

Link to comment
Share on other sites

This I feel is the best way, I already told you

I know that's what you think, and I disagree. You're not learning at nearly the rate that you could be learning if you were choosing more effective teaching tools. To paraphrase Benjamin Franklin, he who teaches himself has a fool for a master. That's also been in my signature for as long as you've been here.

I want a text book!

And what exactly is stopping you from finding one?

Then when they talk for a paragraph long, and get back on subject, then tell you to double back to reread a paragraph from the last page that they could have put in the spot of the paragraph of them self or what ever.

I've never read a book like that, I don't know what you're talking about. I can't suggest anything to you, because any suggesting I make either gets discounted because it doesn't perfectly fit your specific style, or it gets outright ignored. You know what your style is, so you, not me, are responsible for finding books that suit your needs. If you find a book and you don't like it, return it and get another one. I am not holding your hand, your education is your responsibility, not mine, so take some personal responsibility and stop expecting everyone else to hand everything to you. If you can't do the basic research required to find a simple book, then programming is not for you.
Link to comment
Share on other sites

L8V2L,

 

Do you have a local library? Years ago and sometimes now, I look up books online of what I would like to read in regards to programming (or anything really) and then check if my local libraries have them. If they do, great, I check out that book... if I don't like it, I simply return it and get another until I feel that book is what I am looking for. If that book is worth it to me, I actually then purchase it online somewhere via Amazon etc.

 

As of a matter of fact, not too long ago I purchase a JavaScript book called 'PPK on JavaScript' from Amazon simply because I wanted to have it in my collection. Though it is a book that was released mid 2000s, I still wanted to check it out because the author is the person who runs this site: http://www.quirksmode.org/js/contents.html and in the book he talks about/goes over of what is considered 'bad' programming practices in JavaScript and also goes over about how to approach scenarios in regards to the many browsers that are out there when writing your code. In the book, He gives real world examples of projects He actually worked on, which is cool.

 

The book isn't really intended for beginners but there is a chapter in the book that goes over the core of JavaScript but not too much in detail. Maybe not the book of what you're looking for at the moment.

 

Like JSG mentioned I believe, many of the authors pour much of their knowledge into their books.. Regardless of the book, you CAN learn something from it. It's all up to you. If you have personal hurdles in the way, for example, money to get a book... libraries are free. If you have a hard time sitting in one spot and reading a 'big' book, just take it slow; no need to rush it. Rushing it is not good anyway because you may miss what's important for you to understand. IF reading a physical book is not you but prefer reading stuff online/on the computer, many of the books out there are now in PDF format where you can read the entire book on the computer or tablet, etc. There are actual 'readers' now that can read the book for you and you just listen; if that's an option for you.

 

Don't make excuses(like how you mentioned you're not interested in books because the author gets off the topic for a paragraph or too, or is humorous in some places, personally I like that because it helps me understand the author more and their 'view' on programming thus helping me understand everything more). If you really think programming is for you and truly want to learn, you will make it HAPPEN regardless of anything. :good:

Link to comment
Share on other sites

JavaScript: The Definitive Guide, 6th Edition and the pocket version seem to be the type of book I like to read... I have to say; their is something about reading online that I like more... but this book seem to be by type of book. I scheme through the definitive guide it self, and with what little I read gave no room for shenanigan(that was the word I was trying to spell last time). I read more of the pocket version, it being 250 or something, more or less a few hundred less of the definitive version. And it... as JSG state had everything in the beginning of it as I read on mdn and here... more so wordy then the definition guide one which give a little more example from what I seen then the pocket version, but I only read a little of the pocket version. I guess I like books that give a lot of example and example both before and after the example it self; which w3s, and mdn, and phpd, did nicely. I'm currently reading through the mdn guide and almost finish, at the same time I'm reading xml here to pay my respect to both html and xml... now it comes to my attention that I must read xslt... uh! ... I just wanted to know xml(not even know it, just have some kind of knowledge over the language)... The good thing I like about JavaScript is... will like that guy said which I don't agree on at all! It's like a "glue" his words not mind. But anyway, you need two or more things to glue something with, and with JavaScript, it is pushing me into other language... And it don't even feel as if it is pushing me, I just want to know them cause I can do something with them with JavaScript. I can see how JavaScript alone with html, and css can do amazing things with; you could even make a game out of just them three language(although I would use another approach in stand of that). But with other language; such as svg, and apis... why JavaScript it self have been built on top(or for a better and more respectfully putted(as the core for)) other language to exist, as c and java(I believe from remembering correctly) have been done. I see jQuery and those other library as language of them own; cause if one should actually study jQuery as so, they can use it with out any syntax of javascript(not really as it from javascript, so it is javascript... as adam and eve is of guide more if I shall compare it/give i.g. toward). No other language have done so... by that I mean no other language have complemented it's ancestors as so. JavaScript is an amazing language with a large loving community that are adding on it every minute... it's not even finish and look at what an impact it have cause. That why I want to be a JavaScript Wizard; a pure JavaScript wizard to where those other languages to be snack cakes of delight for me to understand. I may be a novice still, but I'm glad that I by the universal power choose this language to learn... or it choose me...Somewhere in the deep dark space a soft but evil laugh is heard.JavaVader: he-he-he~. Soon... Soon.

Edited by L8V2L
Link to comment
Share on other sites

This is... I don't know how I feel about this...

// I understand what's going on giving the time to studying it a little.function makeIterator(array){    var nextIndex = 0;// this increment by one         return {       next: function(){           return nextIndex < array.length ?               {value: array[nextIndex++], done: false} : // <-- here. it increment by one when               {done: true};       }    }}var it = makeIterator(['yo', 'ya']);console.log(it.next().value); // 'yo'// You write it out here with console.log.console.log(it.next().value); // 'ya'console.log(it.next().done);  // true/* By looking at it that what I guess is going on, this is from mdn, and is a new ecma-script 6 proposal... May 14, 2014 7:36:13 PM <== is when it was edit the page I copy this example of The Iterator protocol. I don't know how... I understand by looking at it, but how it set up, I don't think I could give a self example of it.*/
Link to comment
Share on other sites

This is just amazing:

var A = ["1", "2", 3];A[100] = "5";A.length;typeof(a[50]);for(var i = 0, item; item = A[i++] { // <-- this actually perform a Boolean action.console.log(A[i]);}for(var i = 0; i < A.length; i++){var item = A[i];item !== undefined ? console.log(item):"foobar/fubar/baz"; /* I made this one after writing the three example they display to me. The other one just being a regular for loop. Ternary, it so cute! This one is better due to the fact that the other one will stop iterating when it come across an undefined(or falsie value, 0 exception) meaning, it'll never reach 5; but this iteration do the same, but give two an option solution that does nothing; i.e. foobar/fubar/baz. When I think about it, this could had been done with the filter, forEach, ... a couple of other comes to mind but they want do the job as great as they would, if they where design for it... I need to study/go over them more! Arrays are an important part of JavaScript; just as everything else in JavaScript. But those should be efficient enough with a function holding... or just having that as a parameter "item I== undefined?console.log(item):foobar;"similar to what is displayed above with out the for loop. for in work good, but it is said if I remember correctly that should be use with objects. in an Array, it'll iterate everything...*/}
Edited by L8V2L
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...