次のような要素からプラグインを認識させようとしています。
(function($) {
$('#element').myPlugin({});
})($)
別のページで -
(function($) {
$.fn.myPlugin = function(settings) {
var element = $(this);
$.post('connection.php',{},
function(output) {
element.html(output);
});
}
})($)
しかし、何らかの理由で機能していません..私は困惑しています
HTML ページ:
<body>
<div id="element">adsf</div>
</body>