Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE html>
<html>
<body>
<button type="button" onclick="loadfile()">button</button>
<div id="test"></div>
<script>
function loadfile() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("test").innerHTML = this.responseText;
}
};
xhttp.open("GET", "/project/User1/sl_tu3LbAGhjM20203432/file.php", true);
xhttp.send();
}
</script>
</body>
</html>
The most helpful AJAX solutions
How to call php file using javascript ajax ?AJAX
Click to see more ...
922
54
Calling php function with AJAXAJAX
Click to see more ...
910
51
How to get a text from php file using ajax ?AJAX
Click to see more ...
790
49
How to call php function placed in php file using jquery ajax ?AJAX
Click to see more ...
738
47
How to call the php function with jquery ajax ?AJAX
Click to see more ...
660
44
How set interval php function using ajax ?AJAX
Click to see more ...
970
38
How to trigger a code placed in php file using ajax ?AJAX
Click to see more ...
787
27
How to create javascript ajax function ?AJAX
Click to see more ...
612
24
jquery AJAX and calling php function ?AJAX
Click to see more ...
492
21
How to call ajax function and get text from php file?AJAX
Click to see more ...
441
16