There is such a javascript, which passes the variable num to the action_cat file. How do I pass the cat variable in the same way? What, where to add?

<script type="text/javascript"> $(document).ready(function(){ $("#imgLoad").hide(); // Скрываем прелоадер }); var num = 15; //чтобы знать с какой записи вытаскивать данные var cat = 3; // категория $(function() { $("#load div").click(function(){ // Выполняем если по кнопке кликнули $("#imgLoad").show(); // Показываем прелоадер $.ajax({ url: "/func/action_cat.php", // Обработчик type: "GET", // Отправляем методом GET data: {"num": num}, cache: false, success: function(response){ if(response == 0){ // Смотрим ответ от сервера и выполняем соответствующее действие alert("Больше нет записей"); $("#imgLoad").hide(); }else{ $("#content").append(response); num = num + 5; $("#imgLoad").hide(); } } }); }); }); </script> 

    1 answer 1

    Yes, the same:

      type: "GET", // Отправляем методом GET data: {"num": num, "cat": cat}, cache: false, 

    You have everything for this already.