Skip to content

Instantly share code, notes, and snippets.

@atommarvel
Last active August 29, 2015 13:57
Show Gist options
  • Save atommarvel/9809155 to your computer and use it in GitHub Desktop.
Save atommarvel/9809155 to your computer and use it in GitHub Desktop.
//posting
var xmlhttp=new XMLHttpRequest();
var url = "http://marvel.com/my_account/my_must_reads";
var params = "id=";
xmlhttp.open("POST", url, true);
xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlhttp.send(params);
//unchecking
test = document.getElementsByTagName("input")
for(var i = 0 ; i< test.length; i++){
if(test[i].getAttribute("type") == "checkbox"){
if(test[i].checked){
test[i].click();
}
}
}
//activate
// Put The page in a div.
var onOG = true;
var OGdiv = document.createElement("div");
var switchBtn = document.createElement("button");
switchBtn.onclick = function(){
if(onOG){
// switch to sharing site
OGdiv.setAttribute("style", "display:none;");
}
}
div.innerHTML = document.body.innerHTML;
document.body.innerHTML = "";
document.body.appendChild(OGdiv);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment