Have the following code?
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script> var catalog = "", pagen_1 = 1; $.ajax({ url: "https://cors-anywhere.herokuapp.com/http://vm1.culture.ru/abramtsevo/catalog/ajax.php", data: { PAGEN_1: pagen_1, EAR_SEARCH_LEFT: "-99", YEAR_SEARCH_RIGHT: "1999", TEGS: "Живопись" }, type: 'POST', success: function(catalog) { catalog += catalog; for (; ; pagen_1 <=10) { url: "https://cors-anywhere.herokuapp.com/http://vm1.culture.ru/abramtsevo/catalog/ajax.php", data: { PAGEN_1: pagen_1++, EAR_SEARCH_LEFT: "-99", YEAR_SEARCH_RIGHT: "1999", TEGS: "Живопись" }, type: 'POST', success: function(catalog) { catalog += catalog; }, } $("#catalog").html(catalog); }, }); </script> <div id="catalog"></div> Loop error:
data: {- Uncaught SyntaxError: Unexpected token:
What's the matter? And how could it be better to write this code?
$.ajaxcall is$.ajaxand the parameter object immediately goes instead. - Grundyfor (; ; pagen_1 <=10)cycle will never end, because the condition is not written in that section - Grundy