Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js get request

document.addEventListener("DOMContentLoaded", function() {
    const xmlHttp = new XMLHttpRequest(),
        div = document.getElementById('music_all_ajax');
    xmlHttp.open("GET", '{{ route('music ') }}', false); // false for synchronous request
    xmlHttp.send(null);

    div.insertAdjacentHTML('afterbegin', xmlHttp.responseText);
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #request
ADD COMMENT
Topic
Name
8+6 =