2
I have a script that does reload
every 10 seconds, loading a page into a div
:
<script type="text/javascript">
var tempo = 10000;
function listar() {
$.ajax({
url:"lista.php",
success: function (textStatus) {
$('#lista').html(textStatus);
}
});
}
function reload() {
location.reload();
}
$(function() {
listar();
setInterval(listar, tempo);
setInterval(reload, 1800000);
});
</script>
I would like that script, recognizes the type/size of screen (monitor, mobile phone, etc.) and load the file for the size.
Example:
When the screen is one monitor: carry php list.
When the screen is one cellular: carry lista_cel.php
Thiago, I got to test it now dude. So I did like I said, but Reload is crashing the page. From what I’ve seen, he’s been reloading the entire page over and over again. It seems to loop bigger and bigger. Before changing, it only loaded the "list.php". It’s working, but it is with this loop that grows more and more.
– rbz
I played the IF inside the function
listar()
and it worked!– rbz