Replace in the input the string "script" with "code"... that way it will be output as "text". something like this maybe...
$('.edit').editable({
params: function(params) {
var data = {};
data['id'] = params.pk;
data[params.name] = params.value;
return data;
},
success: function(response, newValue){
//gi: Perform a global, case-insensitive replacement:
newValue = newValue.replace(/script/gi, "code");
$(".test").html(newValue);
//if newValue will be <script>alert('hello')</scipt>
// then we see alert message with 'hello'
}
});