<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Run, Pause, Refresh</title>
<style>
.loader {
border: 16px solid #f3f3f3;
border-radius: 50%;
border-top: 16px solid #3498db;
width: 120px;
height: 120px;
-webkit-animation: spin 2s linear infinite; /* Safari */
animation: spin 2s linear infinite;
display: block;
margin-left: auto;
margin-right: auto;
}
/* Safari */
@-webkit-keyframes spin {
0% { -webkit-transform: rotate(0deg); }
100% { -webkit-transform: rotate(360deg); }
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>
</head>
<body>
<script src = '
https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js'> </script>
<script>
function Run() {
let urlParams = new URLSearchParams(window.location.search);
let url = urlParams.get('url');
fetch(url, {
method: 'post',
mode: 'no-cors',
headers: { 'Content-type': 'text/plain' }
}).then((response) => {
setTimeout(function () {
errRdr();}
, 2500); // # of milliseconds to pause for, 2500 = 2.5 seconds
})
}
function errRdr(){
// Redirects to the previous page, if this page was the previous page as well, then redirect to the app home page
if(document.referrer && document.referrer !== window.location.href) {
window.location.href = document.referrer;
}else{
window.location.href = window.location.origin + window.location.pathname;
}
}
Run();
</script>
<h2 style="text-align:center">Made API Calls, will redirect after 2.5 seconds.</h2>
<div class="loader"></div>
</body>
</html>
<!--
These code samples are provided "AS IS" without any warranties of any kind and is not supported by Quickbase teams.
You are responsible for the security and maintenance of any third-party code inside of your application.
Any reliance on Quickbase functions, HTML, CSS or other document-object-model (DOM) elements should be considered unstable and may change at any time, without notice.
Builders should not reference or rely on common libraries hosted by Quickbase (such as jQuery or Angular) as these may change at any time.
Customers should reference their own hosted libraries or from 3rd-party resources that they can trust and maintain
-->