How to create custom JQuery function and how to use it?

后端 未结 6 1590
一向
一向 2020-12-14 15:16

I\'m searching for information about that - \"How to create custom (own) JQuery function and how to use it\"

I\'ve searched in Google, but I didn\'t found informatio

6条回答
  •  伪装坚强ぢ
    2020-12-14 15:44

    For those who are looking for a "custom function" as per the title, it is as simple as:

    if(window.$)
        window.$.customMethod = function() { * your code here * };
    

    This will then work like $.ajax() does

提交回复
热议问题