У меня есть внешняя конечная точка
localhost:5000
, которая загружает простую HTML-страницу с изображением.Там работает флеш-сервер, который обслуживает html-контент.
У меня есть другой html-файл с именем index.html
.В index.html,
у меня есть div под названием movie-data
.Я хочу сделать Ajax-запрос localhost:5000
и добавить html-содержимое в div movie-data
из index.html
.
index.html
: -
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
function init() {
$.ajax({
dataType: "html",
url: "http://localhost:5000",
success: function (data) {
console.log(data);
$("#movie-data").html($(data).append(data));
}
});
init();
</script>
<div id="movie-data"></div>
Это показывает ошибку
Uncaught SyntaxError: Unexpected end of input
init();