Search code examples
jqueryhtmlajaxliveedit

Everything inside < > lost the content in ajax-Jquery html


I'm doing some live edit on my table and I am trying to print some content inside this < sdfsdfsdfsdfs>.

I am not able to print this in html in the jquery html as I'm able to show this content as I give a space before the content then it works fine but without space I lose all the content as well as in stakoverflow question box also

$(document).ready(function()
{

$(".edit_tr").click(function()

var ID=$(this).attr('id');
$("#details_"+ID).hide();
$("#details_input_"+ID).show();
}).change(function()
var ID=$(this).attr('id');
var tagdetailsarea=$("#details_input_"+ID).val();
var newdata=encodeURIComponent(tagdetailsarea);
var dataString = 'printid='+ ID +'&printdetails='+newdata;
$("#details_"+ID).html('<img src="load.gif" />');
if(newdata.length>0)
{
$.ajax({
type: "POST",
url: "print-tags-edit.php",
data: dataString,
cache: false,
success: function(html)
{
$("#response").html(html);
$("#details_"+ID).html(tagdetailsarea);
}
});
}
else
{
alert('You can not Print Blank Data');
}
});
$(".form-control1").mouseup(function() 
{
return false
});
$(document).mouseup(function()
{
$(".form-control1").hide();
$(".text").show();
});
});

Solution

  • Can you try using .text() method in Jquery instead of .html()?