jeudi 19 février 2015

"Mastering" Javascript code fix



javascript:(function(){var%20showAllAnswers=true;appConfig.view="solution";var%20results=getProblemConfig({assignmentProblemID:MxData.assignmentProblemID,viewHidden:true});appConfig.view="work";for(var%20i=0;i%20<%20results.sections.length;i++){var%20section=results.sections[i];var%20link=document.createElement("span");link.className="answer-button%20enabled";link.setAttribute("data-id",section.id);link.title="Show%20Answer";link.innerHTML="Show%20Answer";link.addEventListener('click',function(e){document.querySelector("%23part"+this.getAttribute("data-id")+"%20.show-answer").style.display="block";});var%20answer=document.createElement("div");answer.className="show-answer";answer.style.padding="10px";answer.style.backgroundColor="%23EEF";answer.style.border="solid%201px%20%23CCF";if(!showAllAnswers)answer.style.display="none";answer.innerHTML="Answer%20is%20"+section.showAnswer;var%20node=document.querySelector("%23part"+section.id);if(!node)continue;node.appendChild(answer);if(!showAllAnswers)node.querySelector(".buttons").appendChild(link);}})();


It's not working anymore. Apparently it needs a slight modification. Any help?





Aucun commentaire:

Enregistrer un commentaire