我试图让我的插件识别它被调用的元素,例如:
(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>