Skip to content

Instantly share code, notes, and snippets.

@uladkasach
Last active March 28, 2017 20:26
Show Gist options
  • Save uladkasach/68cc04acf377091335fbff7b6a6603ef to your computer and use it in GitHub Desktop.
Save uladkasach/68cc04acf377091335fbff7b6a6603ef to your computer and use it in GitHub Desktop.
// generate list of values from list of objects's values for a key
var colors = events.map(function(a) {return a.color;});
// add onload, instead of replace
window.addEventListener("load", function_reference);
// Async Request
var xhr = new XMLHttpRequest();
xhr.open("POST", destination_path, true);
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xhr.onload = function(){
console.log(this.responseText);
};
xhr.send('arg1='+val1+'&arg2='+val2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment