Data upload function:

function ShowData(event) { event.preventDefault(); $('#divTXT').load('text/company.txt'); } 

html for upload:

 <div id = "divTXT"> Сюда подгружаются данные TXT </div> 

After loading, the source text in the div is replaced with the loaded one. How to make the div was: source code + loaded?

    1 answer 1

    Decision:

     $.ajax({ url: "text/company.txt", response:'text', success: function (result) { $("#divTXT").append(result); }, error: function (err) { alert("Ошибка"); } }); 

    The append function loads data to existing ones.

    • 2
      $.ajax , and append() adds. - cronfy