Here is the code
$(document).ready(function(){ $('#writesform').submit(function() { $.ajax({ url: "../register/writes/wall_support.php", type: "POST", dataType: "text", data: {write: $('#textarea').val(), button: $('#sub').val()}, success: function(data) { var arr = data.split('^'); var app = '<form><div>'arr[0]'Опубликовал 'arr[1]' администратор 'arr[2]'<button onclick="return delpost();" type="submit" name="number" value="'arr[3]'">удалить</button></div></form>'; $('.wall').append(app); } }) return false; }); });
Ajax
does not work in this case, but if arr[0]
, arr[1]
, arr[2]
, arr[3]
removed from the append
, everything works. What is the problem?