469,325 Members | 1,464 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,325 developers. It's quick & easy.

jQuery - Should I spend my time on it?

TheServant
1,168 Expert 1GB
Hi guys,
I do most of my code in PHP, and when required I will use javascript (although I generally tweak already made code rather than making my own), but I am by no means an expert. I have been trying to find out how to make page content moveable and after exploring the web for a while I have come across several suggestions to use some jQuery functions.

This is purely for looks and is not required, but my questions are:
What are any disadvantages using jQuery over straight javascript? I gather the function library is required and will take more time to download per page? Is it much of a difference?
Do you recommend I learn and use it rather than writing (or finding) javascript functions from scratch?

Thanks for your time.
Apr 28 '09 #1
6 3395
Ciary
247 Expert 100+
i expect by moveable, you mean draggable?

if thats the case, try checking extjs.com. i dont know if you know it but its the best solution to make things draggable/resizable. also, most things that jquery provides can also be done using ext (sliders, buttons, ...)

if u do want to use jquery, it might take a few seconds to load the page indeed. you can also copy its libraries to your page making it faster. but still, its difficult to tweak jquery. ext on the other hand provides an override object in which you can change it's functions.

learning javascript from scratch is fine but some things are just to difficult. there, i advice you to use other libraries.

one more thing, i recommence using it the other way. try using javascript as much as possible and only use php when really neccesary. a few months ago, i swore by php, but now i know, you can do more using js. if you dont see another way then the use of php, try using an ajax request and put the php on that page. it's how i do it.

to use a database: use php to create a XML page and then use an ajax request to get the data.

hope that helped
Apr 28 '09 #2
Dormilich
8,651 Expert Mod 8TB
@TheServant
depending on the cache-control set on JQuery's server. usually the file is cached for subsequent use*, so the library is loaded only the first time it is called.

@TheServant
it's depending on the amount of functionality you use. libraries are good if you have many and complex tasks to do (like menus, eye-candy). I guess it's overkill for simple stuff like form validation.


* - it wouldn't make sense to force a reload every time, although it is possible
Apr 28 '09 #3
Markus
6,050 Expert 4TB
<marketing>
You're always going to, if not now, then in the future, need javascript when developing for the web; and having an awesome framework like jQuery as part of your repertoire will increase user-experience, and, as I just found out yesterday, is something employers will ask for.
</marketing>

In all honesty, it won't take you 5 minutes to get the framework basics, and from there, it's only a case of joining the mailing group on google / reading the _good_ documentation and you're a master.

Now, time to go drink a coffee and watch some scrubs.

Peace out, home dizzles.
Apr 28 '09 #4
acoder
16,027 Expert Mod 8TB
@Ciary
jQuery also provides drag-drop functionality.

if u do want to use jquery, it might take a few seconds to load the page indeed. you can also copy its libraries to your page making it faster. but still, its difficult to tweak jquery. ext on the other hand provides an override object in which you can change it's functions.
That's simply an opinion. There are other libraries too, each with their own fan-boys ;)

one more thing, i recommence using it the other way. try using javascript as much as possible and only use php when really neccesary.
That would be if you want to avoid unnecessary page loads/reloads, otherwise never depend entirely on JavaScript.
Apr 28 '09 #5
gits
5,390 Expert Mod 4TB
now here are my 2 cents too :) ... using a framework like jQuery (or ExtJs, or Dojo, or MooTools, or whatever) first depends on what you typically need. in case you just use basic functionality that you always need to have customized i would suggest to create your own 'custom' lib that generalizes your own JavaScript handling ... so that you could just reuse your code without the need of duplicating it, that would even give you the idea on how such frameworks work and what you would expect from such a framework ... but! and as you could see, that would lead to a kind of custom 'framework' and you could even consider one of the above mentioned frameworks to use as your base-framework. with such an approach you would have a base-lib that you would get to know better every time you would use it and typically you would start to use more and more of its methods, possibilities etc. ... using a lib that you create by your own would give you optimized code for your needs ... on the other hand: using a generalized lib gives you the lever to leverage your apps to another level ... and the power of the lever depends on your choice of the framework you would like to use. jQuery is quite powerful ... so are Dojo and ExtJs ... but all of them are a bit more 'heavy' compared to just prototype or MooTools ... but all of them have their area of use ... and typically the load-time doesn't suffer much from including any of such a lib.

kind regards
Apr 28 '09 #6
TheServant
1,168 Expert 1GB
Thanks everyone for your replies. I think I will download the jQuery library onto my server (so it's local) and then start reading. And for the record, I meant draggable, yes, but more generally as Dormilich said, "eye-candy".

I am sure i will be around the Javascript forums quite a bit for now while I try get deeper into the experience that is: Client Side!
Apr 28 '09 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by DuaneMoraes | last post: by
3 posts views Thread by poe | last post: by
1 post views Thread by mikeh3275 | last post: by
83 posts views Thread by liketofindoutwhy | last post: by
20 posts views Thread by Aaron Gray | last post: by
26 posts views Thread by RobG | last post: by
53 posts views Thread by souporpower | last post: by
5 posts views Thread by jrod11 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by mdpf | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.