It is necessary that when you click on the link, the picture and description change. They are put in different id and far apart on the page. For example, if you use such a function, it will change one and with the same data. And it is necessary that the data were taken from two different squeaks and inserted into different places.

function getColorList(id, type, desc, link) { jQuery.ajax({url: "/catalog/colors.php", dataType: "html", type: "GET", data: { c: id, types: type, desc: desc}, success: function(msg) { //alert(msg); document.getElementById('colCont').innerHTML = msg; }, error: function(XMLHttpRequest, textStatus, errorThrown) { //alert('Ошибка'); } }); }; 

    1 answer 1

     var elements = new Array('id1','id2','id3'); for(idAttr in elements){ element = document.getElementById(idAttr); element.onclick = function(id, type, desc, link){ getColorList(id, type, desc, link); } } 
    • and on server side how to distribute it on id - Tchort
    • From c: id, types will be retrieved - knes
    • And you could not write completely, including what I wrote, I do not understand how it will look at all, where to insert what you wrote. - Tchort