Skip to content

Instantly share code, notes, and snippets.

Avatar

Christian Mendoza christianmendoza

View GitHub Profile
View ajax-vanilla-js.js
/* http://idiallo.com/javascript/ajax-without-jquery */
var url = "http://jsonplaceholder.typicode.com/posts";
var Ajax = {
xhr : null,
request : function (url, method, data, success, failure) {
if (!this.xhr) {
this.xhr = new XMLHttpRequest();
}
View christian_awesome.js
// Object Oriented Life Motto
var me = world.getPerson("Christian Mendoza");
if(me !== null) {
while(me.isAlive()) {
if(me.isSad()) {
me.setSad(FALSE);
me.executeAwesomeness();
console.log("huzzah");
}
else {