我即将使用pikachoose.com 具有wordpress的库。但是,该库引用jQuery,并使用缩写形式(使用$)。在WordPress文档中,它声明不应该使用短格式,相反,我应该使用长格式来使用jQuery功能并防止冲突。
我的问题是,我下载的库/对象是以简写形式编写的。那么我如何将其与WordPress结合使用呢。WordPress中的文档说明我应该这样包装它:
jQuery(document).ready(function($) {
// Inside of this function, $() will work as an alias for jQuery()
// and other libraries also using $ will not be accessible under this shortcut
});
或者像这样:(function($) {
// Inside of this function, $() will work as an alias for jQuery()
// and other libraries also using $ will not be accessible under this shortcut
})(jQuery);
但是,如何包含外部文件尚不清楚。请举例说明。谢谢