1. code:

(function($){

       $.hello = function(str){alert("hello "+str);}

  })(jQuery);

2: note:

    如果页面作者使用了Prototype,且已调用了$.noConflict(),则$被占用,

    通过将jQuery传递给$形参,来解决问题。

 

相关文章:

  • 2021-07-25
  • 2022-12-23
  • 2022-12-23
  • 2021-06-01
  • 2021-09-09
猜你喜欢
  • 2021-10-20
  • 2021-06-23
  • 2022-01-17
  • 2022-03-07
  • 2021-08-08
  • 2021-10-25
相关资源
相似解决方案