Hey, welcome to ZBCode, the premier coding forum for ZB. Here you fill find some of the best Invisionfree and Zetaboards Codes on the network! Unfortunately, you're sorta hovering around in guest mode at the moment; why not join in on the fun? Register an account and you can start accessing the wealth of resources we have available here. Enjoy your stay at ZBCode, and remember to tell all your friends about us; the more members, the more codes available. ![]() Interested in joining? Click here. If you are already a member of ZBCode, feel free to login right here: |
- Pages:
- 1
- 2
| First steps of Javascript | |
|---|---|
| Tweet Topic Started: Feb 5 2009, 06:14 AM (533 Views) | |
| Vitality | May 19 2009, 02:22 PM Post #11 |
|
Tabula Rasa
![]()
|
Nice Reid ![]() Honestly Everafter, just take a step back and try not to over think it. I think that's a huge problem with those trying to learn; it looks scary so you tend to make it more difficult than it should be. Try to think straight to what code will cause this, but more along the lines of actualizing your situation. Think through what you're trying to do before you start writing any code. What I mean by that is break it down. Think to yourself; okay, here is my page. It's filled with arrays, elements, objects and so on. Then first, locate where you need to apply the code; for example, on all <a> tags, rather all links. That right there just prevented us from searching every single thing on the page you're on and narrowly reduced it to only links. Now you would say; okay, I have all of the links on this page, but I want to change the text of this specific one. You would see that with what you have you can't change only one (because you currently have all of them =P), you need to do some searching. No problem, but how can I pinpoint that one link? Get specific. Look at what is unique about that link. Is it it's text, or maybe to be even isolate the search matches even more, it's address. Look at that. You now have your link and you can do what you want with it. Try to think sort of like that and then once you've figured out what you want to do, then figure out and remember which code will help you do that. Sometimes analogizing helps. For exmaple: An array can be an aisle in a store, your methods/functions can be you with a cart and so on. Try visualizing the process of what you're trying to achieve. |
![]() |
|
| Reid | May 19 2009, 02:48 PM Post #12 |
![]()
What? The land of the free? Whoever told you that was your enemy.
![]()
|
I have almost every step/way of doing something planned out before I even open up notepad++ to start the code. It isn't very specific, but a general idea of how you're going to do something is immensely useful. After all, you don't start building a house without knowing the size, shape, and location, do you..? |
| The Resource Board | |
![]() |
|
| slayer766 | May 19 2009, 05:11 PM Post #13 |
![]()
Hello all
![]()
|
Well that's a house, totally different perspective. Hahaha, but yeah I see your point though Reid. I tend to usually jump right in the code and think of stuff on the way but with RPG projects and such that are quite large, I then try to think of stuff in my head(because I don't write anything down <_<) and then go from there. |
![]() |
|
| Everafter | May 20 2009, 12:01 PM Post #14 |
![]()
|
* nods * okay. Im reading over the tutorials right now. Getting my feet wet. One day I will get it. Even if there is something similiar on here I will still at least know that I did my own version. * snickers * the last program I ever used was basic. |
![]() |
|
| Viral | May 20 2009, 06:44 PM Post #15 |
![]()
|
condition ? true : false is called a tertiary statement iirc . As for the triple === and stuff, they're mainly used when comparing with a boolean (true or false).var this_is_me = true; // the variable this_is_me will be equal to true var this_is_you = false; // the variable this_is_you is equal to false Now, to test it, using an if statement: if(this_is_me === true){ // execute } That's how you'll normally see it. Or if you like the tertiary way (shorthand): var definitely_me = this_is_me === true ? "yes" : "no"; That defines the variable definitely_me. It checks whether this_is_me is equal to true, which it is, so definitely_me is now equal to yes. If this_is_me was equal to false, then definitely_me would be equal to no. I have no idea how much you know, but I'm pretty sure this is a bit too complicated (I've repeated myself too much). It might help though. |
![]() | |
![]() |
|
| Reid | May 20 2009, 07:11 PM Post #16 |
![]()
What? The land of the free? Whoever told you that was your enemy.
![]()
|
Tertiary eh? I'll keep that in mind.. lol |
| The Resource Board | |
![]() |
|
| Viral | May 25 2009, 09:46 AM Post #17 |
![]()
|
Ternary* |
![]() | |
![]() |
|
| Reid | May 25 2009, 01:26 PM Post #18 |
![]()
What? The land of the free? Whoever told you that was your enemy.
![]()
|
Indeed. The triple equal signs are used to check for type as well as actual equality, apparently. For example, if I did this: Apparently. Or something like that.
|
| The Resource Board | |
![]() |
|
| iBlake | Jun 12 2009, 06:35 AM Post #19 |
![]()
|
Thanks. I understand those tags better. |
|
| |
![]() |
|
| Choco | Jul 2 2009, 09:14 AM Post #20 |
|
¡ʎɹoʇɔɐɟ ʎʇıʌɐɹƃ ɐ uı pǝddɐɹʇ ɯ,ı 'dןǝɥ
![]()
|
Easier way to put it is that it checks type as well as value instead of just value. ![]()
|
It's a magical world, Hobbes, ol'd buddy... ...let's go exploring!In progress: Something Special ;) | |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Code University · Next Topic » |
- Pages:
- 1
- 2






















7:47 PM Jul 10