x1nick Posted March 16, 2011 Share Posted March 16, 2011 I have a default plugin (function($) { $.lsc = function (json) { $.lsc.vars = json; if (json['toolbar']) $.lsc.toolbar (); } //Create essential functions $.extend ($.lsc, { init: function () { //some code }, }); }); This appears to work fine Now when my whole project is in debug mode, a seperate javascript file is loaded with the following (function($) { //Create essential functions $.extend ($.lsc, { toolbar: function () { alert(1); }, }); }); But I get the following error: $.lsc.toolbar is not a function How can I create a plugin and extend in a seperate file with additional functions when my project is in debug mode? I have never written a jQuery plugin before and struggling to get my head round it Quote Link to comment https://forums.phpfreaks.com/topic/230860-extending-a-jquery-plugin/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.