You did not escape the apostrophes in 'this' and '3'.
The correct markup is this:
<span style="cursor:pointer;" onclick="$(this).parent().html('input type=\'text\' value=\'asdasd\' onkeydown=\'javascript:if(char_click(event)==13){send_ajax_settings($(this),\'title\' ,\'3\')}\'>');">asdasd</span>
However, such binding events are very bad practice and lead to the type of errors you just had. You should do it like this:
<span style="cursor:pointer;" class="spanClass" data-param1="title" data-param2="3">asdasd</span>
<span style="cursor:pointer;" class="spanClass" data-param1="title2" data-param2="5">asdasd</span>
... more spans generated dynamically
and do the following:
$(document).ready(function(){
$(".spanClass").click(function(){
var param1 = $(this).attr("data-param1");
var param2 = $(this).attr("data-param2");
$('<input type="text" value="asdasd" />').keydown(function(event){
if(char_click(event)==13) {
send_ajax_settings($(this), param1 , param2));
}
}).appendTo($(this).parent());
});
});
, javascript html , .
, .