jQuery Ajax response
Maybe something like this?

success: function (json) {
  var decorators = {},
      handlers = {};

  // decorators prepare content for insertion
  decorators.naslov = stripslashes;
  decorators.tekst  = stripslashes;

  // specialized handlers
  handlers.tag_title = function (value) {
    // do the tokenization-stuff here
  };

  // Go through the response
  $.each(json, function (index, item) {
    var value = item.value;
    // if the field has its own handler, use that
    if( typeof handlers[item.field] === "function" ) {
      handlers[item.field](value);
    } else {
      // Otherwise, send the value through the decorator
      // (if there is one for the given field), and
      // insert the value in the corresponding input
      if( typeof decorators[item.field] === 'function' ) {
        value = decorators[item.field](value);
      }
      $("#" + item.field).val(value);
    }
  });
}