Skip to content

Instantly share code, notes, and snippets.

@joahg
Created November 26, 2013 17:21
Show Gist options
  • Save joahg/7662305 to your computer and use it in GitHub Desktop.
Save joahg/7662305 to your computer and use it in GitHub Desktop.
The magic behind JoahG/cc-forumfix_chrome-extension
(function(){
if (typeof CCDATA.forum != "undefined" && window.location.pathname.split("/")[window.location.pathname.split("/").length - 2] === "forum_questions") {
id = window.location.pathname.split("/")[window.location.pathname.split("/").length - 1];
$.ajax({
url: "http://www.codecademy.com/forum_questions/" + id,
dataType: "json",
type: "GET",
beforeSend: function (e) {
e.setRequestHeader("X-Requested-With", "XMLHttpRequest");
e.setRequestHeader("Accept", "application/json, text/javascript, */*; q=0.0")
},
success: function (e) {
console.log(e)
}
})
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment