I am reading an Excel file through javascript ..
<button onclick="myStopFunction()">Stop Meter</button> var myVar=setInterval(function(){readdata(1,2)},2000); function myStopFunction() { clearInterval(myVar); }
code to read excel file
var xVal = 1; var yVal = 2 function readdata(x,y) { x = xVal; y = yVal; try { var excel = new ActiveXObject("Excel.Application"); excel.Visible = false; var excel_file = excel.Workbooks.Open("D:\\Test1.xls");
Now I want to get rid of the stop counter in such a way that when the excel value is empty or null, it will exit. How to do this I tried something like this
if(xVal==null& xVal=="") { clearInterval(myVar); }
but i did not succeed
source share