0
So I’m taking the HTML content from an external site and rendering in my hybrid application. So far so good. I have the following code so far:
$.ajax({
url: '{{SuaUrlAqui}}',
headers: {'X-Requested-With': 'XMLHttpRequest'},
type: 'GET',
success: function(res) {
var data = $.parseHTML(res);
$(data).find('div#main').each(function(){
$('div#noticias').prepend($(this).html()); //Mudar essa função aqui.
});
}
});
The problem is that this page in the APP will only work if user is connected to the internet. What I wanted was to save this content in a file and upload the information from that file, which would be updated every time the user opened the application connected to the internet. Is there a function that writes the content I picked up in a . html file with Jquery?
You can use the client browser’s localStorage to store the request data and use it as "offline cache" - https://medium.com/dev-channel/offline-storage-for-progressiveweb-apps-70d52695513c
– Rômulo Gabriel Rodrigues