Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

114
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!