AJAX how set interval php function ajax - Net-Raft.com

Welcome aboard! We are happy you are here and wish you good net-raft!




Just a Web Code Solution

How set interval php function using ajax ?


 399

Show Result
insert_into_php_file.txt
AJAX


1

<!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>


By        
The power of the user (%)
15%



The most helpful AJAX solutions

How to call php file using javascript ajax ?How to call php file using javascript ajax ?AJAX

Click to see more ...

  605     53

Calling php function with AJAXCalling php function with AJAXAJAX

Click to see more ...

  563     51

How to get a text from php file using ajax ?How to get a text from php file using ajax ?AJAX

Click to see more ...

  458     49

How to call php function placed in php file using jquery ajax ?How to call php function placed in php file using jquery ajax ?AJAX

Click to see more ...

  413     47

How to call the php function with jquery ajax ?How to call the php function with jquery ajax ?AJAX

Click to see more ...

  225     44

How set interval php function using ajax ?How set interval php function using ajax ?AJAX

Click to see more ...

  399     37

How to create javascript ajax function ?How to create javascript ajax function ?AJAX

Click to see more ...

  337     24

jquery AJAX and calling php function ?jquery AJAX and calling php function ?AJAX

Click to see more ...

  182     21

How to trigger a code placed in php file using ajax ?How to trigger a code placed in php file using ajax ?AJAX

Click to see more ...

  221     18

 How to call ajax function and get text from php file? How to call ajax function and get text from php file?AJAX

Click to see more ...

  142     16