Problem with outputting html via AJAX

Posted by Marek on Stack Overflow See other posts from Stack Overflow or by Marek
Published on 2010-05-06T20:22:10Z Indexed on 2010/05/06 20:28 UTC
Read the original article Hit count: 177

Filed under:
|
|

Hello

I am new to JS and AJAX, but I have to do my homework. I choose jQuery, so it little easy now. I want to get a html via AJAX request, but in result it looks, ex:

<fieldset id=\"item4\" class=\"item\"><legend>Odno\u015bnik 4<\/legend>

I set response content-type to text/html. When I outputting result on server everything is ok.

jQuery code:

enter code here  $.ajax({
                                    dataType : 'html',
                                    data : 'add_sz='+changeSize+'&next_id='+nextId,
                                    url : '/kohana/admin/menus/ajax_items_refresh',
                                    error : function(err, xhr, status) {
                                        msgOutput.text('error msg');
                                    },
                                    success : function(data, xhr, textStatus) {
                                        msgOutput.text('success msg');
                                        var tabs = $('#items-list');
                                        $('#items-wrap').html($('#items-wrap').html() + data);

Could somebody help me?

What I am doing wrong?

Kind Regards.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery