I have written this js function for calling ajax for every 15 seconds duration.
But it should be limited based on other conditions
<script type="text/javascript">
var disableReload = '<s:property value="#session[\'EXECUTOR\'] == null" />';
var tId = window.setTimeout(function () {
location.reload(true);
//alert(disableReload);
if(disableReload){
//alert("Clearing");
clearTimeout(tId);
}else{
var url = 'my.action';
var form = document.getElementById('myForm');
var params = Form.serialize(form) + '&ms=' + new Date().getTime();
var myAjax = new Ajax.Request(url, {method: 'post', parameters: params, onComplete: showResponseAction} );
}
}, 15 * 1000);
</script>
but when disableReload is true; clearTimeout is not clearing/removing reload function.
How can I achieve that.
If I understood your intention, then something like this is what you need: