| This board has been archived and is no longer accepting new questions. If you have a support question for your ZetaBoard, please visit us at the new support board. Registration is free and easy. Visit the NEW ZetaBoards Support forum! |
| Functions; To help sprouting coders | |
|---|---|
| Topic Started: Feb 12 2008, 02:17 PM (2,688 Views) | |
| Viral | Feb 12 2008, 02:17 PM Post #1 |
|
i'm stanley nao
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Safari 3.0: 100% Firefox 2.0: 100% Opera: 100% IE 7.0: 100% Basically, I made this yesterday. It's a compilation of different functions to help coders out and hopefully 'giver birth' to some newer ones. If you have this script installed on your ZB forum, you can call any of the below functions:
There aren't that many at the moment, but if I can have some suggestions on what to add, that would be great. For now, this goes in the Javascript box, as high as possible.
Edited by Viral, Mar 19 2008, 06:47 PM.
|
![]() |
|
| Arrogant | Feb 12 2008, 02:24 PM Post #2 |
![]()
Vote Choco and Nicola!
![]() ![]() ![]() ![]() ![]()
|
err... Viral, i'm not sure if you're aware of this... but your scripting doesn't exactly flow.. >.> i mean, it's all in bug chunks, small chunks, chunky.. chunks.. :s i'm not one for using jQuery, and i think i've voiced my opinion on that quite a bit... but man, for the love of God... please.... Please... PLEASE... consider learning how to make your script flow..
Edited by Arrogant, Feb 12 2008, 02:26 PM.
|
![]() |
|
| Viral | Feb 12 2008, 02:26 PM Post #3 |
|
i'm stanley nao
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
beta, I see your point. I was just reading GS's blog, and have already started changing stuff into jQuery. Don't worry, everything that is jQuery possible is being edited now. |
![]() |
|
| Arrogant | Feb 12 2008, 02:29 PM Post #4 |
![]()
Vote Choco and Nicola!
![]() ![]() ![]() ![]() ![]()
|
no, it's not that. sometimes, things aren't worth scripting in jQuery. you just have to know how and when to use it, is all. for example - your inbox thing: you don't need jQuery for that, and i've edited it out of my post. you just need to tie everything up into a nice little function.
to be honest, you're good at JavaScript, and you're improving quite a bit. you just need to learn how to make things minimal and efficient. d: Edited by Arrogant, Feb 12 2008, 02:33 PM.
|
![]() |
|
| Viral | Feb 12 2008, 02:37 PM Post #5 |
|
i'm stanley nao
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
But, it's easier for jQuery in a place like that, as the coding is shorter. Obviously, not everything should be used in jQuery but stuff like that should. |
![]() |
|
| Arrogant | Feb 12 2008, 02:42 PM Post #6 |
![]()
Vote Choco and Nicola!
![]() ![]() ![]() ![]() ![]()
|
true, because it's already loaded up and whatnot - but the browser still has to parse the arguments and return a function based on what was entered into them. i'm not quite sure on how long it takes to do all of that, but i've found that it's much faster to just code normally, without jQuery dependence (especially when doing small-scale things... :s). i haven't checked the actually timing on it all, but when i code normally, it seems to just happen alot faster compared to when i rely on jQuery. ahh... invasion of the typos! D:! x.x Edited by Arrogant, Feb 12 2008, 02:46 PM.
|
![]() |
|
| Interrobang | Feb 12 2008, 05:22 PM Post #7 |
|
Yeah, I went there.
![]() ![]() ![]()
|
The timing on a jQuery #id selector is almost parity with getElementById(). The timing on a proper "element.class" selector is almost parity with any JS you use, not counting the fact that you have to write a class selector function. The speed difference, unless you're doing something like manipulating a 1000-row table (at that point, I agree that you should use plain JS), is so minimal that I heartily agree with Viral that increased readability and reduced development time >>>> the 10 ms you save in a script. No one is going to notice. jQuery is shorter to write and easier to read, making it more maintainable. I'm sure that you can find much better ways to optimize scripts than rewriting everything with longhand selectors. And I'd still like to see your version of something like this without jQuery: jQuery is a good tool. Don't discourage people from using it. No one here is going to be writing enterprise-level stuff on which milliseconds hinge. |
![]() |
|
| Arrogant | Feb 12 2008, 08:17 PM Post #8 |
![]()
Vote Choco and Nicola!
![]() ![]() ![]() ![]() ![]()
|
again, "you just have to know how and when to use it, is all." :p of course using plain JavaScript to do something like what you presented would be less practical. however, most people don't know how to use jQuery, nor would they ever be bothered to learn it. so, as far as it having increased readability, you're dead wrong.
Edited by Arrogant, Feb 12 2008, 08:23 PM.
|
![]() |
|
| Viral | Feb 13 2008, 08:20 AM Post #9 |
|
i'm stanley nao
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
But isn't that just saying (for example), "Don't use PHP because some people won't understand it, or be able to read it"? |
![]() |
|
| choco | Feb 13 2008, 08:24 AM Post #10 |
|
SPORE
![]() ![]() ![]() ![]() ![]()
|
That's a bad example, as PHP code isn't commonly viewed while running, unless you're putting it out for the world to see. Also, PHP is a programming language; jQuery isn't.
|
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| Go to Next Page | |
| « Previous Topic · User Created Codes · Next Topic » |




![]](http://209.85.62.24/static/1/pip_r.png)




9:49 AM Dec 8