問題描述
幾個月前,我開始使用 jQuery 插件進行一些實驗.我在 Internet 上找到了一些教程,然后開始整理.
幾天前,我需要構建自己的插件"并回到我的舊項目.試圖在互聯網上找到更多信息,我偶然發現了這些稱為小部件的新東西".
Few months ago I started some experiments with jQuery plugin. I found some tutorials on the Interenet and I started to put something together.
A couple of days ago I had the need to build my own "plugin" and got back to my old project. Trying to find some more informations on the internet, I bumped in these new "things" called widgets.
據我所知,我應該忘記插件并開始開發小部件.插件是一個舊概念還是仍然有效?如果您需要帶有界面的自定義 jquery 控件,最好的方法是什么?
For what I understand I should forget about plugins and start developing widgets. Are the plugins an old concept or are still valid? What is the best approach if you need a custom jquery control with interface?
我正在廣泛使用 jQuery UI.
I am using extensively jQuery UI.
推薦答案
您可以編寫 jQuery 插件 或 jQuery UI 小部件.
取決于你想做什么.這些都不是過時的.如果你寫一個小部件,它會依賴 jQuery UI(當然還有 jQuery),如果你寫一個插件,它只會依賴 jQuery.真的,這取決于您想要實現的目標.
Depends on what you want to do. Neither of these is outdated. If you write a widget, it will depend on jQuery UI (and jQuery of course), if you write a plugin, it will only depend on jQuery. Really, it depends on what you want to achieve.
這篇關于jQuery 插件與小部件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!