0
Script php pentru a detecta mobile version

Rezolvat 1 Raspunsuri 438 Vizualizari Internet
Detectează mobile version prin script php

1 Raspuns

0
Cel mai bun raspuns


<script type="text/javascript">
 
function detectmob() {
   if(window.innerWidth <= 800 || window.innerHeight <= 600) {
     return true;
   } else {
     return false;
   }
}

if (detectmob()){

top.location.href="mobile.php";
}

function startTime() {
    var today = new Date();
    var h = today.getHours();
    var m = today.getMinutes();
    var s = today.getSeconds();
    m = checkTime(m);
    s = checkTime(s);
    document.getElementById('ceas').innerHTML =
    h + ":" + m + ":" + s;
    var t = setTimeout(startTime, 500);
}
function checkTime(i) {
    if (i < 10) {i = "0" + i};
    return i;
}
 
</script>

raspuns Februarie 19, 2017 de TheDavid (1,140 puncte)
...