Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
</head>
<button onclick="myStopFunction()">stop interval</button>
<body>
<script type="text/javascript">
$(document).ready(function () {
var str = "Your_Interval";
myVar = setInterval(function () {
$.ajax({ url: '/project/stone01/sl_yLL4QsnIRf2020100213/phpfile.php?mytext=' + str,
data: 'functionName=myfunc',
type: 'get',
success: function (data) {
var obj = data;
eval(obj);
}
});
}, 3000);
});
function myStopFunction() {
clearInterval(myVar);
}
</script>
</body>
</html>
The most helpful AJAX solutions
How to call php file using javascript ajax ?AJAX Click to see more ... 718 54