Clipbucket javascript

Hello, in the channel of a user in clipbucket, down page there are the tabs “Activity”, “Infos”, “Videos”, “Groups” and “Photos”…
When I click in Videos, Groups and Photos tabs clipbucket doesn’t load and show them, could you help me solve this?
the only problem sometimes I get in javascript error consol is “The object doesn’t support the method appendTo”. I marked red the line with the problem in the code below here.
you can see the problem in this page, logging in with “arvixe” as username and password

<snip>

Thank you :slight_smile:

function channelObjects(object,div,type,user,assign)
{
	var obj = $(object), curRel = obj.attr('rel'),
		DIV = $(div), oldRel = obj.parents('ul').find('a.selected').attr('rel');
	
	if(curRel)
	{
		if($("#"+curRel).css('display') == 'block')
			return false;
		else
		{
			obj.parents('ul').find('a.selected').removeClass('selected');
			obj.addClass('selected');
			
			$("#"+oldRel).hide();
			$("#"+curRel).show();		
		}
	} else {
		var newRel = type+"DIV";
		obj.attr('rel',newRel);
		$.ajax({
		 url : page,
		 type : "POST",
		 dataType : "json",
		 data : ({ mode : "channelObjects", content : type, user : user, assign : assign}),
		 beforeSend : function() { obj.append(loading_img) },
		 success : function(data)
		 {
			obj.find('img').remove();
			obj.parents('ul').find('a.selected').removeClass('selected');
			obj.addClass('selected');		
		
			$("#"+oldRel).hide();
			[COLOR="#FF0000"]$("<div></div>").attr('id',newRel).addClass($("#"+oldRel).attr('class')).html(data.html).appendTo(DIV);[/COLOR] 
		 }
		})	
	}

Off Topic:

No, porn links are not allowed. Hopefully the question can be answered without the link. Otherwise, in future, put up a test page demonstrating the code but without the porn on a test domain etc.

The problem is that jQuery’s html() method returns a string, not a jQuery object.

I think all you need to do is move the “appendTo” earlier in the chain, so that it’s before the “html” method.

Of course, there might be more going on; that’s just the first thing that jumped out at me.

Off Topic:

Are we allowed to link to porn?

I checked on the official clipbucket site and the function is exactly like mine so the problem isn’t there and i don’t know why it doesn’t show them…
it call elements that are in the mysql database so i guess there is some php code associated with js doing that but where is?

thank you