Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

108
Visualizações
Cordova updating part of page

I created a login page with javascript. After a succesful the function loadMainActivity is called. As of now the contents are as follows:

async function loadMainActivity(){
    document.getElementById("container").innerHTML = "This is a text.";
}

It works. However, now I want to load a complete HTML page upon a succesful login. I tried several plugins to this end. However, all of them require me to load a file. As I see it I have two options:

  1. Provide an extra file with the app. This would enable my users to see the source, which I don't want.
  2. Host the file on a server. This would require my users to have an active internet connection when using the app, which I also don't want, for now at least.

I thought about "stringifying" the HTML page and replacing "This is a text." with the obtained HTML string. That way I could keep the source closed. But this seems like a lot of extra steps. Besides, I cannot find a good method to do this stringification of HTML text.

How to solve this problem for a Cordova app?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I found that this can be done with the jQuery library, nothing specific to Cordova:

async function loadMainActivity(){
    $.get("mainactivity.html", function( my_var ) {
        document.getElementById("container").innerHTML = my_var;
    });
}
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda