mercredi 1 juillet 2015

ajax response needed to be assigned to a div

I am implementing an image gallery using an Ajax call.

The call passes a value and gets an HTML code as a response. I checked this response and it is correct.

And if I put this code into a static DIV, the gallery works with no problems.

But if I inject the code with AJAX, when I click on an image, it opens in the window as a normal image: the gallery pop-up is not working.

What could be the cause of this problem?

The code is as follows

$.ajax({

    type: 'GET',
    url: 'www.test.com',
    data: {
        type: product,
        use: 'gallery'
    },
    dataType: 'html',
    success: function(data) {
        $("#dv_gallery").append(data);
    }

});

the following is the HTML code in the page

 <div class="portfolio-adaptive adaptive-three" id="dv_gallery"></div>

Aucun commentaire:

Enregistrer un commentaire