0

I'm currently using a jQuery resides on my own FTP together with other web files. I am thinking of using a jQuery from CDN since suggested by the YSlow. The question is, how can I extend that jQuery? Or in other words, how can I add custom functions to it? I don't think I can edit that? Ha-ha! Thanks!

kazinix
  • 28,987
  • 33
  • 107
  • 157

2 Answers2

2

You use a separate file with your own functions in it.

Any extension to jQuery should probably be done through its own plug-in mechanism.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
1

Whether the jQuery library comes from your own server or a CDN, you'll add new functions in the same way.

jQuery.fn.yourCustomFunction = function(){};

This will be done inside your own Javascript files and you should never be editing the actual jQuery library file.

Jamie Dixon
  • 53,019
  • 19
  • 125
  • 162