Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- members.forEach(function(element) {
- //console.log(element);
- var out = [];
- for (var key in element) {
- if (element.hasOwnProperty(key)) {
- out.push(key + '=' + encodeURIComponent(element[key]));
- }
- }
- var http = new XMLHttpRequest();
- var url = 'http://192.168.8.103:3902/api/member/add/admin';
- var params = out.join('&');
- http.open('POST', url, true);
- //Send the proper header information along with the request
- http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
- http.onreadystatechange = function() {//Call a function when the state changes.
- if(http.readyState == 4 && http.status == 200) {
- console.log(http.responseText);
- }
- }
- http.send(params);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement