1

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

Of course 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 .

2
  • 1
    Why there's a need of conversion...? Commented Feb 21, 2010 at 11:49
  • i think you just need to make ur own js framework to be reusable dont need to make it a jquery funcs basicly cause jquery is from javascript so where is the conversion Commented Oct 9, 2011 at 13:52

3 Answers 3

6

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?

Sign up to request clarification or add additional context in comments.

4 Comments

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.
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.
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.
I agree entirely with @bobince.
3

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.

Comments

1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.