[SOLVED] Refreshing a page and redirect if an event occurs.
Hello,
I have looked for my problem in Internet but I couldn't find. I don't know why I have used the correct words or the problem is in other places.
I design a mobile page web with ajax to refresh the content (div[data-role=page]).
I update the page tag because the server can redirect to other page.
I use this code to refresh.
setInterval(function() {
$.ajax({
url: 'index.php?action=state',
dataType: 'html',
timeout: 1000, // 5 seconds
success: function(html) {
$('div[data-role=page]').html($(html).find('#other'));
$( "div[data-role=page]").trigger('pagecreate');
}
});
}, 2500);
But the title <h1> in my div content disappear. This problem I couldn't find in Internet.
Do I need to call other trigger?
Thank you!