Hi guys, I just want to ask how to use Ajax in Laravel 4.2, because everytime I used simple Ajax and returning the result from other php file, my page always crashing.
Here's my example code:
<div id="getData"></div>
<script>
function display(){
xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "select.php", false);
xmlhttp.send(null);
document.getElementById("getData").innerHTML = xmlhttp.responseText;
}
display();
setInterval(function(){
display();
}, 500);
</script>
The select.php file echo data from the database (e.g. 354)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community