2

Is there a way to reduce jQuery to functions that I need.

In this case, I only want to use getJSON with the callback function. I don't need anything else of jQuery. Is there any way to cut this out?

Thanks, Mike

Michael Mikhjian
  • 2,760
  • 4
  • 36
  • 51
  • 1
    jQuery is open source. You could attempt to strip out that function from a non-compressed build, but you'd likely be in for a lot of pain. – Michael Berkowski Nov 10 '11 at 01:55
  • Are you building a component? I ask because the file is 31k; it is served from a CDN and the client most likely already has it cached. – rkw Nov 10 '11 at 02:21
  • If you are using Webpack you can use my solution to a similar question: https://stackoverflow.com/a/68224584/ – Giorgio Tempesta Jul 02 '21 at 11:45

2 Answers2

2

You can do AJAX without jQuery. One explanation: http://davekb.com/browse_programming_tips:easy_ajax:txt

mike jones
  • 649
  • 4
  • 15
0

Not really, there are a lot of dependencies, but modularity is planned.

As an aside, a getJSON() function isn't particularly hard to implement.

alex
  • 479,566
  • 201
  • 878
  • 984