-2

I'm currently developing a web application and I was forced to use jQuery for some animations and other specific purposes, but still most of my code is written in JavaScript.

Should I rewrite these JavaScript modules if after all jQuery is being loaded every time? I know that in some cases it is better to use JavaScript instead of jQuery because it is faster and some other advantages but I'm already using jQuery throughout the page and I'm wondering should I use it everywhere instead of loading the whole library for few chunks of code.

Will there be any significant difference in the performance if the library is already loaded?

Gonrah
  • 18
  • 1
  • Possible duplicate of http://stackoverflow.com/questions/3393900/is-plain-vanilla-javascript-better-than-using-frameworks-like-jquery-or-mootools?lq=1 – Tobias Xy Mar 24 '16 at 10:35
  • 2
    jQuery is javascript but pre-written to make source code short/cleaner and to make developers life easier during development. – NewToJS Mar 24 '16 at 10:35
  • a good maintainable javascript is always better than jquery but jquery makes the code more readable and easy to understand (IMO). Instead of rewriting, i would suggest to make the separation very visible or trying to make it as a plugin code which jquery can initialize. – Cerlin Mar 24 '16 at 10:35
  • is it worth your time to rewrite something that already works? I'd tend towards finding ways to live without jQuery – nepeo Mar 24 '16 at 10:39

2 Answers2

3

There won't be any difference, the Javascript speed is better. The performances wihout libraries still better. So keep your modules

0

Its up to you.

If you don't like to use any JS library, then you have code a lot.

The current jQuery v1.12.2(supports IE 6,7,8) size is 97kb. You use CDN version to reduce the loading time of it.

Will it affect the performance?? Yes, a bit it will do.

You didn't mention whether you are making any XMLHttpRequest;

if so, its better to use jQuery for better cross browser compatibility.

Pandiarajan
  • 126
  • 8