SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Threaded View

  1. #1
    SitePoint Member
    Join Date
    Nov 2011
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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

    Code:
    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();
    			$("<div></div>").attr('id',newRel).addClass($("#"+oldRel).attr('class')).html(data.html).appendTo(DIV); 
    		 }
    		})	
    	}
    Last edited by ralph.m; Dec 17, 2011 at 02:12. Reason: link removed


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •