AJAX trigger code placed php file ajax - Net-Raft.com

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




Just a Web Code Solution
join us

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


 521

Show Result
php.php
AJAX


1

<html>
<body>

<button type="button" onclick="loadfile()">click</button>

<div id="test"></div>

<script>
function loadfile() {
str = "is cool!";
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("test").innerHTML = decodeURIComponent(this.responseText);
}
};
xhttp.open("GET", "/project/User1/sl_jlvL8ZStJd2021113413/php.php?t=" + str, true);
xhttp.send();
}
</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 ...

  674     54

Calling php function with AJAXCalling php function with AJAXAJAX

Click to see more ...

  626     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 ...

  528     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 ...

  483     47

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

Click to see more ...

  283     44

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

Click to see more ...

  522     38

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

  521     27

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

Click to see more ...

  400     24

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

Click to see more ...

  243     21

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

  196     16

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