Access Div content after update via Ajax

0

Good morning everyone,

I have a question, I am making an Ajax request where I reload the contents of a Div and I put the answer, but I need to access the response that has been loaded with a jquery function, this file is linked to my project , but it does not execute the function that I need at the moment when the div is reloaded.

Function Code that updates the Div

$ ('# maker'). on ("change", function () {

    if ($(this).val() == 0){
        $.ajax({
           type: 'POST',
           url: '?c=index&m=queryAllReferences',
           data: null
        }).done(function (response) {
            $('#responseQueryReferenceForMaker').load( response);
        });
    } else {
        $.ajax({
           type: 'POST',
           url: '?c=index&m=queryReferenceForMaker',
           data: {value: $(this).val()}
        }).done(function (response) {
            $('#responseQueryReferenceForMaker').html(response);
        });
    }
});

Code of the function in which I take the updated div info

$ ('# reference'). on ("change", function () {

    alert($(this).val());
    /*if($(this).val() == 0){
        alert($(this).val());
        $.ajax({
           type: 'POST',
           url: '?c=index&m=queryFunctionForReferenceDefault',
           data: null
        }).done(function (response) {
            $('#resultQueryOnlyFunction').html(response);
        });
   } else {
        $.ajax({
           type: 'POST',
           url: '?c=index&m=queryFunctionForReferenceIndexController',
           data: {valueReference : $('#reference').val()}
        }).done(function (response) {
            $('#resultQueryOnlyFunction').html(response);
        });
   }*/
});
    
asked by SANCHEZ LARRARTE BRAHIAN SLEYD 17.08.2018 в 18:27
source

1 answer

0

What I want is to take the information of a div that update with ajax.

Now edit the question, thanks for not uploading images.

    
answered by 17.08.2018 в 20:43