Here is JS my code where I intend to get 2 DIVs and use there content.

    $.post(
        someAction,
        $.param(outData),
        onUpdatePostSuccess
    );
    function onUpdatePostSuccess(data)
    {
        alert(data);
        var newTitleHTML = $("#newTopicTitle", data).html();
        var newContentHTML = $("#newTopicMessage", data).html();

            if (newTitleHTML && newContentHTML)
            {
                $("#topicTitle").html(newTitleHTML);
                divMsg.html(newContentHTML);
            }
            else
            {
                divMsg.html(data);
            }
    }

The alert(data); code line returns the following HTML code:

<div id="newToticTitle">New Topic Title</div>
<div id="newTopicMessage">New Topic Message</div>

BUT, the code is always goes to else section in if conditional.

Where can be the problem? I've used the same code in other section of
the script and it works fine. Have spend a day struggling the problem
but no luck :( Seems that I can't make any actions like

$(expr, context)

in onUpdatePostSuccess function.

Reply via email to