CSP how to auto refresh with COS

I have a query that I would like to  have refreshing at certain intervals lets say every 30 seconds with out refreshing the page content using the META TAGS

refreshes the whole page but I have a jquery function that will run at those intervals that I can use the problem is getting the jquery to call my COS function or is the way to do it with pure COS

 

<html>
<head>
<!--meta http-equiv="refresh" content="30"-->
<!-- Put your page Title here -->
<title>    Cache Server Page </title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/
libs/jquery/1.3.0/jquery.min.js"></script>
<script type="text/javascript">
var auto_refresh = setInterval(
function ()
{
$('#load_tweets').load('#(..myquery())#').fadeIn("slow");
}, 10000); // refresh every 10000 milliseconds </script>
</head><body>
<div id="load_tweets"></div>
<script language="Cache" method="myquery" returntype="%Integer">&sql(select Count(*)INTO:COUNTER from Collection)
QUIT COUNTER
</Script>
</body>
</html>

 

 

Answers

Here's one idea (no idea if it would work though):

  1. Extract query into a new csp page.
  2. Make it auto-refresh with META TAGS
  3. Embed it into a root page using INCLUDE.

 

Long-term I recommend using REST API for that.