Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

I have a small bug I was hoping someone might be able to help me with. I made a very simple JavaScript timer to display the amount of time spent on a task. Obviously it needs to display through the web viewer. It works well enough, however it sometimes causes Filemaker to get stuck when I attempt to leave the layout. This happens in FileMaker Pro and Go. Has anyone ever encountered a similar problem. I've added the code. It currently had a button to activate it for while I'm testing but I'm planning on having it load automatically. 

"data:text/html," &"
<html>
<head>
<script type="text/javascript">


function setCount()
{
var start = " & GetAsNumber(TimePoints|Today_Workers::Time.Start) & ";
var d = new Date();
var t = d.getHours()*3600 + d.getMinutes()*60 + d.getSeconds();
var diff = t - start; 
var h = Math.floor(diff/3600);

var m = Math.floor( (diff - h*3600)/60);
var s = diff - h*3600 - m*60;
if(h<10) {h='0'+h;}
if(m<10) {m='0'+m;}
if(s<10) {s='0'+s;}
var soFar = h + ':' + m + ':' + s;
document.getElementById('timer').innerHTML = soFar;
var run = setInterval( function(){setCount()},1000);
}
 

</script>
</head>
<body>
<p align="center">Time so far is: <b id='timer'>??</b>
<input type='button' onclick='setCount()' value='Show the Time'/>
</p>
</body></html>"
  • 2 weeks later...
  • Author

Ok, it turns out that I made a stupid mistake. Since I'm not too familiar with JavaScript I wasn't considering how the interval function worked. I just realized that by putting setInterval in the function, it was starting a new cycle of timer updates everytime it ran. In other words, every time it ran it created a duplicate timer. This would increase exponentially every second. This inevitably took up all of the resources allocated to FileMaker. By putting setInterval into a separate function it will run the original function every second without a problem.

Create an account or sign in to comment

Similar Content

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.