Problem solved and well understood
The main part of the problem was I did not know that the argument of the handler is DOM event. I thought that _columnName
will receive event data which was wrong. It is DOM event in fact.
The working code follows:
<script>
function changeContent(event) {
$.ajax({
type: 'POST',
url: '@Url.Action("GetHomeColumnContent")',
data: JSON.stringify({ columnName: event.data.a }),
dataType: 'json',
contentType: "application/json; charset=utf-8"
}).done(function (resp) {
CKEDITOR.instances.text.setData(resp.Text);
}).fail(function () {
alert("Error");
});
}
$(function () {
$("#side-content").bind('click', { a: 'side' }, changeContent);
});
</script>
And about the cyclic value: DOM elements are cyclic in nature because every DOM element has a reference to its parent, and in turn every parent has references to its children, so a cyclic structure.
Thanks to all friends for their times: @Dogbert, @nnnnnn, @AD7six, @Xotic750 ;-)