Just a doubt. In the ajax URL field, when I work with MVC, I usually place the action / controller. Well, in my case now I have a asp page. What happens is that the ajax is on the same page that I'm going to load. I'm asking this because it did not work out here, but since there was a problem in the bd and it was not being loaded, I preferred to wait until the people below put Oracle in the air, but that's right, that is, I put the page where I'm? See the skeleton. The page is named ../asp/prs0061a_cons_crossbrowser.asp
. Here's the ajax I've done:
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) {
}
})
}
Personal, I have two files. prs0061a.asp
and prs0061b.asp
. In prs0061b.asp
I 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 populated 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 get the loaded variable from the database and unload in the table? I edited the question, since the previous form was a bit confusing. If there is a need for a new question, I think the issue has improved my question.