Routine ajax doubt populating the page itself

Asked

Viewed 88 times

0

Just one question. In the ajax URL field, when I work with MVC, I usually put the action/controller. Well, in my case now I have an Asp page. What passes is that ajax is on the same page that I will load. I’m asking this because it didn’t work here, but since there was a problem in the comic book and it wasn’t being loaded, I preferred to wait until the people below put the Oracle on the air, but that’s right, I put the page I’m on? Look at the skeleton. The page is called ../asp/prs0061a_cons_crossbrowser.asp. Look at the ajax I made:

function CarregaTabela(){

var str = '';

$.ajax({
    url: '../asp/prs0061a_cons_crossbrowser.asp',//dúvida aqui
    datatype: 'json',
    contentType: 'application/json; charset=utf-8',
    type: 'POST',
    data: JSON.stringify({}),
    success: function (data) {

        $(data.variável_populada_com_info_do_oracle).each(function () {

            str += 'o_campo_a_ser_populado_na_table';
        })

        $('#id_do_tbody_da_table').html(str);

        str = "";

    },
    error: function (error) {
    }
})
}

Guys, I have two files. prs0061a.asp and prs0061b.asp. In the prs0061b.asp have this routine:

set rsPesquisa = rsCursorOracle( CStr(Session("ace_usuario")),_
                                 CStr(Session("ace_senha")),_
                                 CStr(Session("ace_ip")),_
                                 CStr(Session("ace_sistema")),_
                                 CStr(Session("ace_modulo")),_
                                 "prs_rcs_gestao.get_prestador_tipo", _
                                 vetPL, _
                                 false )  

The variable rsPesquisa is filled with what comes from Oracle. In the other file, prs0061a.asp, I have my ajax:

function CarregaTabela(){

var str = '';

$.ajax({
    url: '../asp/prs0061a_cons_crossbrowser.asp',//dúvida aqui
    datatype: 'json',
    contentType: 'application/json; charset=utf-8',
    type: 'POST',
    data: JSON.stringify({}),
    success: function (data) {

        $(data.variável_populada_com_info_do_oracle).each(function () {

            str += 'o_campo_a_ser_populado_na_table';
        })

        $('#id_do_tbody_da_table').html(str);

        str = "";

    },
    error: function (error) {
    }
})

}

How do I take the loaded variable from the bank and download it in the table cited? I edited the question, because the previous way was a bit confused. In case there is a need for a new question, but I think the edition has improved my doubt.

  • You checked on the console of browser if you get an error?

  • @Randrade, good afternoon. No. In my case now the oracle is off, I can’t state anything, but when I did this function, I’ve already made that doubt, whether it’s right or not the way I did it. See, the function and the form to be loaded are in the same file.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.