thehalpeen

Javascript clock

Discussion created by thehalpeen on Dec 9, 2016
Latest reply on Apr 17, 2017 by JackRodges

I inserted a webviewer on my page to display the time. I used code from W3 Schools (see below).

 

The time displays very nicely on my Filemaker file, which is on the Desktop.

 

However when I open the same file on my iPad (I'm sharing it from my desktop), the time is blank and underneath is the following message:

"The requested URL was not found on this server"

 

Is this because the file is on a desktop and not a server - and Filemaker Go not able to handle Javascript  - if the file is being read from a Desktop

 

The code is as follows:

<!DOCTYPE html>

 

<html>

<head>

<script>

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('txt').innerHTML =

    h + ":" + m + ":" + s;

    var t = setTimeout(startTime, 500);

}

function checkTime(i) {

    if (i < 10) {i = "0" + i};  // add zero in front of numbers < 10

    return i;

}

</script>

</head>

 

 

<body onload="startTime()">

 

 

<div id="txt"></div>

 

 

</body>

</html>

Outcomes