-
Posts
788 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by L8V2L
-
-
Huh?!You talking about changing tag elements' attributes of SVG tags?The SVG tutorial tells you pretty much all you need to know about SVG. Animation on the web is not done using SVG, it's done by changing the properties of different elements on the page.
-
Thanks.Right.
I had a feeling you was going to say that:Test it out and see what happens. this refers to the current scope, so if you use console.log(this); inside the function then you can inspect the scope in the developer tools to see if it is defined inside that scope.
function foo(){function bar(){return(this)};return(bar());};console.log(foo());/*return the window object as assume(<-- feel as if this is the incorrect word to use. But I check it on my favorite dictionary site, and it is correct, I have trouble with pronunciation to; which is why I misspell a lot). Is this the correct test to perform?*/
HUH! YOU COULD ALEAST TRY! You might be surprise.I've always been here, I just don't answer questions if I don't think you will understand the answer.
-
Statement and expression, he have operator in reference, but it's in the wrong place, it should be:expressionoperator <-- or this first, but this make since to have in this order.statementObjectThat way when someone reads down ward, thy are getting it from the simplest understanding from reference to the composite understanding.what isn't? I don't know what you're trying to say.
-
JSG IS BACK!!! YEAH~!! so the one that is an expression with the variable defined out side the function is global, and the other one is local being defined completely in the function it self? What if I put the variable inside the function, would it be defined as a local scope and with that, not work as it does being defined as a global scope?Both of those function declarations "work" fine, they just do different things. It's up to you as the programmer to know what you're doing and what you need to use. The difference between those definitions is scope, one of them gets defined in a local scope and one of them in the global scope. If you don't understand scope then further explanation on that won't help, you need to understand scoping. Scoping in Javascript is one of the most important concepts to understand. If you don't understand what a scope is then study it until you do. This is another example of where you need to be writing and testing code and using your browser's developer tools to help you figure out what is going on, reading alone is not sufficient.
-
expand the SVG tutorial, and reference explanation etc. web animation is being implementing.
-
SEREVEAR SIDE SCRIPTING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!SERVER SIDE SCIRPTING JAVASCRIPT!!!!!!!!!!!!!!!!!
-
Yes, I remembering that you gotten the code that I ask to work, but I was confuse on why didn't it work the way I had it, but seen that as you said, having setting the variable out of the local scope... comprehending that is another story.varName, which is basically the method i used in my earlier post was merely a way to show how you can use closures.funcName, won't work at all. unless it is either a helper function to something else inside the onload or the function is actually assigned while still inside the onload. but by itself it won't workYou are failing to understand what is actually available before the page fully loads. Functions are available before onload runs (even before javascript actually executes any code). Javascript is available before the page even fully loads. but pretty much anything you get by using "document" and it's functions... that has to wait until after the page loads. "function" doesn't need to be inside the window.onload handler, but things like "document.getElementById()" do.both methods can work just fine, its just that you're doing one of them wrong.
comprehending that is another story...Thanks both of you for helping toward understanding it.Both of you get likes from me!!!!This seems like a very simple and easy to understand approach, and you could very easily apply a namespace to it.
-
Just wanted to comment to you... What are you studying?Good suggestion, it is really difficult for us to find the liked posts unless we have used an excel or something else to record the posts.
-
Yeah he's right, I start using mines a few days ago... problem is, the background color interfere with text boxes like these, so I can't see what I'm typing.most browsers allow you create your own user stylesheet that will override whatever the styles for a given site are.
-
It's not in reference.what are you looking for that you can't find? have you even looked in the reference? I found everything in your post
- [*]statement -
and the whole reference of everythinghttp://www.w3schools.com/js/DEFAULT.asp
-
You can simply establish a namespace, and use it, or you can use a closure to establish a namespace and have private static variables and private functions. Why do you need private static variables and private functions? Tell me. Explain it.
because myFunction is defined inside fin. Why do you have the function wrapped in another function? What is the point? If you had your developer tools and console open, you would see a function not defined error.
He's trying to use the most advanced stuff he's ever seen in his very first program.
It's not even that this stuff is advanced per se, it's just not practical, or practically applied.
I belive I knowwhere my confusion lies:you're already doing that by assigning a callback to onload. just assign myFunction to window.onload
var varName;window.onload = function(){//which one is correct? Please example fully, for this is where my confusion lies.function funcName(){}varName = function(){};}
-
So the code will be ready to be invoke after the document have loaded
-
<!DOCTYPE html><html> <head> <script> var changeh1; function init() { var cnt=0; //YES! This is what I wanted... similar to it! changeh1 = function(){ /*<~~Why fail as "function changeh1()"?*/ document.querySelector("p").innerHTML="success cnt="+(++cnt); } } window.onload = init; /*To JSG, I TOLD YOU THERE IS AWAY TO DO THE COUNT EXAMPLE LIKE THIS! JA~VA~SCRIPT!!!*/ </script> </head> <body> <h1>My First JavaScript</h1> <button type="button" onclick="changeh1()">click me</button> <h1></h1> <p></p> </body></html>
...Davej got frustrated-ly mad at me.... even yield at me. -
I post the something too!
-
.... No.. I want the onclick to work with out sitting it in JavaScript. I need to have it in a function to be onloaded when the document finishing loading so it can work, but it work out side the function onload... I don't understand why, and don't really feel secure if I wrote code in an external file that it'll function as so.The whole point of using a closure is to avoid using the global space. If you are going to use the global space THEN YOU DON'T NEED A CLOSURE.
-
... I'm ask this question a while back, and did not get no answer. I'm asking why not? Why do I have to define the onclick event in JavaScript? Why can't it be done in the start tag/node/element itself? Why?JAVASCRIPT SERVER SIDE SCRIPTING!!!!!!!!!!!!!!!!!!Go ahead. Try. It just proves that you don't know what you're doing.
-
Statement and expression in JavaScript's reference. condition, loop statement, etc.
-
<!DOCTYPE html><html><head><script>window.onload = function(){var cnt = 0;function changeh2(){document.getElementById('myh2').innerHTML='success success success, cnt=' + cnt++;}//document.getElementById('btn1').onclick = changeh2;//invoke onclick in the button element/node/tag itself. not in the script tag.}</script></head><body><div><h2 id="myh2">Let's change this text</h2></div><button type="button" id="btn1" onclick="changeh2()">Change Content</button></body></html>
-
for the onload event.it should work. Why won't it work and show me how to make it work please.What is the point of it? The function fin() is still sitting there in the global space.
-
I want to read it here first, before I venture off to other source i.g. books && tutorial guides, references, manuals, etc.I think it'll be a good ideal for people who know JavaScript to get into serve side scripting, and by introducing it along php and other serve side scripting example equivalents, will encourage them to learn those language as well..So introduce it as serve side scripting, but not with node.js, just mention node.js as a softer ware to make this possible to do. But mostly show case technique to a compulsion this, and other if they exist.More so, try to coerce them into php or the whole server side scripting section.Well, there is Node.js. https://www.google.com/?gws_rd=ssl#q=node.js+nodejs+tutorial
-
Ajax forms you mean?javascript is client side browser script only, but can retrieve data through SERVER side language script such as php, asp, asp.net through ajax from for example a database.
-
YES! But introduce it as... Don't all server side scripting need an application or software to operate?I think it'll be a good ideal for people who know JavaScript to get into serve side scripting, and by introducing it alone php and other serve side scripting example equivalents, will encourage them to learn those language as well..So introduce it as serve side scripting, but not with node.js, just mention node.js as a softer ware to make this possible to do. But mostly show case technique to a compulsion this, and other if they exist.More so, try to coerce them into php or the whole server side scripting section.Well, there is Node.js.
-
Why doesn't this work!!!!?????
<!DOCTYPE html><html><head><script>function fin(){function myFunction(){document.getElementById("myDiv").innerHTML="njinnjknj";}}window.onload = fin;</script></head><body><div id="myDiv"><h2>Let AJAX change this text</h2></div><button type="button" onclick="myFunction()">Change Content</button></body></html>
-
JavaScript sever side scripting!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!JavaScript!!!!!PLEASE JAVASCIRPT SERVER SIDE SCRIPTING!!!!PLEASE!!!!!HE-MAN: THE POWER!!!!!!!!!!!!You could write it parallel to php server side scripting tutorial examples and use that to get people to want to go through php, and the other server side scripting languages.
Graphic & Animation
in JavaScript
Posted