views:

266

answers:

3

I'm not familier with Javascript, and I have to convert a Project's Javascript codes to Jquery scripts.

ofcourse I'm not project leader or something like it, I'm just elaborating that this process may has what kind of issues and may face with what kind of needness ?

So if you know any solution to convert Javascript Functions to Jquery ones please help me know what should be considered .

+1  A: 

Nope, I am afraid there is no such converter, even if there was you would still have to do some changes yourself. I would suggest you to go through Jquery docs to know the differences and implement right away. Thanks

Sarfraz
+6  A: 

Adding jQuery to an existing project with JavaScript on it shouldn't break any existing JavaScript unless you're using a conflicting framework such as prototype, in which case you can often get away with both being present simply by setting jQuery to noConflict mode.

There's certainly no need to rewrite working JavaScript functions into jQuery if they're working fine as they are unless your primary goal is to improve efficiency / write shorter code or even if it's simply because the JavaScript has become too cumbersome to maintain.

In summary if you just want to add some new jQuery functionality to a website; why not just add it and leave the existing JavaScript as is?

Steve
We want to improve eficiency of our website and also as its a large website, in a long time some developer will work with that, and as Jquery coming to be a flexible and shorter code. we are looking for a way to convert our javascripts to jquery scripts. Also some ofour scripts became a add-in or plug-in for jquery which help us have flexible codes.
Nasser Hadjloo
That's fair enough, unfortunately there's no converter to perform such a task, you'll have to rewrite them yourself. I'd suggest just reading up on the jQuery documentation and about the various shortcuts jQuery provides you with to get around longer bits of your JavaScript code.
Steve
Don't expect converting plain JavaScript functions to jQuery to make your site more efficient. In many cases the extra overhead will make it slower. jQuery is about compact code, not necessarily performance as such.
bobince
I agree entirely with @bobince.
Steve
+3  A: 

JQuery is essentially a set of JavaScript functions that make some JavaScript tasks easier.

If you have an existing JavaScript project it will work without any conversion, but you might decide that certain sections will be shorter and more maintainable if you take advantage of certain JQuery functions.

I don't know of any conversion utilities that will do this for you, but the nice thing is that you can decide which bits you want to convert. You can make this decision based on time available and know that your project will work regardless of how much jQuery you decide to use.

Richard