开发者

Uplodify jquery problem with variables

开发者 https://www.devze.com 2023-04-02 11:53 出处:网络
I\'m working in a small project which envolves uplodify. Everything is working good but I have a small problem with a variable and I don\'t realize where the problem is.

I'm working in a small project which envolves uplodify. Everything is working good but I have a small problem with a variable and I don't realize where the problem is.

What I'm doing here is splitting the reposone. Then I use the splitted information to create links such as BBCODE for forums and HTML code for websites and append them into textareas.

The problem is that my html_code variable is not working because it has a syntax problem (at least that is what I belive) but I can't find it.

The BBCODE is working great and is being shown i开发者_C百科n a textarea, but not the HTML.

Below a portion of the Uploadify code I'm using. Please take a look at the html_code variable.

'onSelectOnce'   : function(){$('#fileQueue').show();$('#mfstart').show();},
'onAllComplete'  : function(){$('#fileQueue').hide();$('#mfstart').hide();},

onComplete : function(event, queueID, fileObj, response, data) {


aa = response.split('||');
var imurl=aa[0];
var thumb=jQuery.trim(aa[1]);

link_url=''+imurl+'\n';

forum_code='[URL='+imurl+'][IMG]http://localhost/imgsum/uploads/thumbs/'+thumb+'[/IMG][/URL]';

html_code='<a href="'+imurl+'" target="_blank"><img src="http://localhost/imgsum/uploads/thumbs/'+thumb+'" border=0></a>';


$('#codes1t').append(link_url);
$('#codes2t').append(forum_code);
$('#codes3t').append(html_code);

}

});

thanks for your help guys.


You should use the .html() function instead of append.

so $('#codes3t').html(html_code); should work.

0

精彩评论

暂无评论...
验证码 换一张
取 消