0

I recieve an array with AjaxPetitions Array[0],Array1, Array[2] and recieve the information correctly.

$.ajax({
                url:'obtenersubastas',
                dataType:'json',
                type:'get',
                cache:true,
                success:  function (response) {
                    $(response).each(function(index,value)  {
                            console.log(response[index].nombre);
                            console.log(response[index].descripcion);
                            console.log(response[index].cant_actual);
                            console.log(response[index].images);
                            console.log(response[index].data_final);
                            console.log(response[index].id);
                    });

                },              
        });

I need to send this information to a class called .nombre html , could anyone helps to me ?

UPDATE

with append I have a problem , i need to follow a style in the page and the result is this.

enter image description here

1 Answer 1

1

You can use $('.nombre').html() to add your values in the selector element.

Try this code

 $.ajax({
            url:'obtenersubastas',
            dataType:'json',
            type:'get',
            cache:true,
            success:  function (response) {
                $(response).each(function(index,value)  {
                       $('.nombre').append('<p>Nombre :' +response[index].nombre +' descripcion: '+ response[index].descripcion + ' cant_actual: '+response[index].cant_actual +' images : '+ response[index].images +' data_final: '+ response[index].data_final +' id :'+ response[index].id+'</p>');
                });

            },              
    });
Sign up to request clarification or add additional context in comments.

6 Comments

With this form , I only can show one elemente of the array , specifically the last one.
@jcsa , instead of .html(), you can use .append() to get all data.
I did this chang and I explain the problem now @Bhavin Solanki
To @jcsa i have update code for this issue. I have add P tag for each new record
@jcsa Happy to help......i think you need to use some bootstrap class to get proper output. If you like my answer please up vote and accept, if you would like....
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.