Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

107
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda