Skip to content

Instantly share code, notes, and snippets.

@veltman
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save veltman/9500952 to your computer and use it in GitHub Desktop.
Save veltman/9500952 to your computer and use it in GitHub Desktop.
Bad.js for @brittanystoroz, circa 2008
function sndReq() {
chosen = false;
document.getElementById("choices").style.display = "none";
document.getElementById("words_left").style.display = "none";
document.getElementById("words_middle").style.display = "none";
document.getElementById("words_right").style.display = "none";
document.getElementById("playagain").style.display = "none";
document.getElementById("playagain").innerHTML = ' ';
document.getElementById("left_inner").style.cursor = "pointer";
document.getElementById("middle_inner").style.cursor = "pointer";
document.getElementById("right_inner").style.cursor = "pointer";
for (i = 0; i < 3; i++) {
//alert("top ("+ document.getElementById(choice_divs[i]).style.top + ") bottom (" + document.getElementById(choice_divs[i]).style.bottom + ")");
document.getElementById(choice_divs[i]).style.top = '0px';
}
document.getElementById("loading").style.display = "block";
var urlstring = 'fetch.php';
http.open('get', urlstring);
http.onreadystatechange = handleResponse;
http.send(null);
//randomize choice_divs
choice_divs.sort(function() {return 0.5 - Math.random()});
document.getElementById("left_inner").style.borderColor = '#999999';
document.getElementById("left_inner").style.backgroundColor = '#ffffff';
document.getElementById("middle_inner").style.borderColor = '#999999';
document.getElementById("middle_inner").style.backgroundColor = '#ffffff';
document.getElementById("right_inner").style.borderColor = '#999999';
document.getElementById("right_inner").style.backgroundColor = '#ffffff';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment