0

I have AJAX call that works and return me JSON

Here is AJAX call

<script>
$('#display').click(function () {
    var vacancyId = $("#vacancy").val();
    var model = {
        vacancyId: vacancyId
};

    $.ajax({
url: '@Url.Action("Links", "Questions")',
contentType: 'application/json; charset=utf-8',
data: JSON.stringify(model),
type: 'POST',
dataType: 'json',
processData: false,
success: function (data) {
    var question2 = data[0];
    $(".videolist").append('<video>' + question2.Linkes + '</video>');
}
});

});

I need to append <video> block where src will be question2.Linkes

How I can do this?

Eugene
  • 219
  • 2
  • 14

1 Answers1

0

If you video file is mp4.

You have to use below.

var videoHTML = '<video>';
videoHTML += '<source src="'+question2.Linkes+'" type="video/mp4">';
videoHTML += '</video>';
$('.videolist').append(videoHTML)
onekwan
  • 26
  • 3
  • It works well, but one thing , it gets src like `http://localhost:51542/Interwier/uploads/130227898.webm` and I need `http://localhost:51542/uploads/130227898.webm` I made code like this now ` videoHTML += '';` – Eugene Apr 04 '17 at 12:22
  • Have one question, if I has many links in json array, how I can display all? – Eugene Apr 04 '17 at 13:17