3
It is possible to send two JSON at the same time as the parameter value date jQuery.ajax()?
Is there any way to call these two arguments, since I need to call these two json and show on screen?
Follow the code below:
var token = "Xke;
var jsonTipo1 = "{ tipo: 1, numPagina: 1 }";
var jsonTipo2 = "{ tipo: 2, numPagina: 1 }";
$.ajax({
    type : "POST",
    url : "https://producao-ws.talcoisa.net/api/Produto/conteudo/",
    processData : false,
    data : json, jsonTipo2,  
    success : sucesso,
    error : errar,
    beforeSend : function(xhrObj) {
        xhrObj.setRequestHeader("tokenApp", token);
        xhrObj.setRequestHeader("Content-Type", "application/json");
    },
});
//Ws
// Responsável por chamar metódos responsáveis pelos títulos e imagens  que vem do json
function sucesso(jsonTipo1 , jsonTipo2) {
    mostrarImagemNaTelaJsonTipo1(json);
    mostrarTituloNaTelaJsonTipo1(json);
    mostrarImagemNaTelaJsonTipo2(jsonTipo2);
}
function errar(json) {
    ToastMessage.showMessage("Fail!");
}
What should these be
jsonTipo1andjsonTipo2? The second parameter of callbacksuccessis thetextStatus.– André Ribeiro
type 1 refers to those images and type 2 other images, the two are part of the same Json. The idea is to update these images within html.
– Faro
In your callback
sucessothe parameterjsonTipo2will contain thetextStatusreturned from the ajax request. Your question is really very confusing. Try to rewrite and say exactly what is going wrong and what is the expected outcome.– André Ribeiro
To send two JSON through the same request, you must merge them through the method Concat(). But you’re confusing what each argument jQuery.ajax() represents. Read the documentation again and see that they are not your JSON. Whatever you "show on screen" will be what the server language sent as output (eg a PHP echo/print).
– Bruno Augusto