My problem is the following code! I want extend a jQuery Object to my XjQuery object and i seems to be work. but in the each function where i will find the object the function myfunc is not declared whats wrong here?
cheers and
sorry for my poor english
XjQuery = function()
{
var jq = $("<div id=xjq>hallo</div>");
$.extend(this, jq);
}
XjQuery.prototype.myfunc = function() {
this.append("<p>myfunc called</p>");
}
xjq = new XjQuery();
xjq.myfunc(); // this works
$("#maindiv").append(xjq); // works also
$("#maindiv").find("#xjq").each(function() {
$(this).myfunc(); // doesn't work
});