So, I'm getting 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 APP will only work if user is connected to the internet. What I wanted was to save this content in a file and load that information, which would be updated every time the user opened the application connected to the internet. Is there a function that writes the content I got in a .html file with Jquery?