problem about sinemacula-Record and share programming errors
Ben Carey
javascript jquery oop jquery-plugins sinemacula
ExplanationFirstly, I might be mixed up between the jQuery constructor and init functions, if so please ignore my terminology below.I have an object called SineMacula, which, at the moment is simply acting as a namespace for a library of methods.However, I am about to write some methods for the SineMacula object which I would like to act like jQuery extensions.The complication arises here, instead of using the jQuery alias $, I would like to use the SineMacula object to run the jQuery construct. So effectively my code will look like this:SineMacula(‘#test’).dropdown();instead of:$(‘#test’).dropdown();However, I don’t think this would be too hard if it wasn’t for my next point:I do not want to alias the whole of jQuery, I simply want the jQuery constructor to run when I call SineMacula(‘something’), and then apply any methods to the result of SineMacula(‘something’)My QuestionThe best way to ask this question is by illustrating. Is the following possible?SineMacula(‘#test’).someFunction(function(){// Do something here// The jQuery object must be passed in so that// $(this) refers to SineMacula(‘#test’) });However, I do not want to be able to do this (fully alias jQuery):SineMacula(‘#test’).animate(); // A regular jQuery functionI am aware this is probably not possible, but felt it was worth asking :-)UPDATE 1Just to be clear, this is some of the code I am cur
Ben Carey
javascript jquery sinemacula
This is probably not possible but worth asking. I am dynamically inserting script tags into my head section of my page. At the moment I am using document.write which many of you will frown upon, but it does do the job fine.However, for the reasons outlined
Originally posted 2013-09-01 20:43:45.