Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function searchByKeyword () {
- var http=new XMLHttpRequest();
- http.onreadystatechange = function () {
- if(http.readyState == 4 && http.status == 200) {
- var result=JSON.parse(http.responseText);
- document.getElementById('contentDiv').innerHTML += '<div class="col-lg-8 col-md-8 col-xs-12">' +
- '<h2> <span class="crvena"></span></h2>' +
- '<div class="supstitut counter-box sc-animate animated fadeInDown" data-effect="fadeInDown">' +
- '<div class="supstitut-img">' +
- '<i class="fa fa-file-text-o"></i>' +
- '</div>' +
- '<ul>';
- result.forEach(function (result)
- { /*if(method=="main") {*/
- document.getElementById('contentDiv').innerHTML +='<table><tr style="width: auto;">' + +
- '<td><span class="supstitut-heading">Ime studenta:</span>'+result.name+'</td>'+
- '<td><span class="supstitut-heading">Prezime:</span>'+result.surname+'</td>'+
- '<td><span class="supstitut-heading">Broj indexa:</span>'+result.index+'</td> <br/>' +
- '</tr></table>';
- });
- document.getElementById('contentDiv').innerHTML += '<br/>';
- }
- };
- http.open("GET", "http://localhost:9090/api/student/all", true);
- http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
- http.send();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement