I like it, but it seems kinda glitchy


My code works in my own editor, when I paste it in the codecademy editor I can see in the preview it's doing what it's supposed to. But I'm still getting an error message. I have been through the treehouse courses and I need a break from them. I like this format, except...the bugginess. This same thing has happened several times tonight.



Please provide more information: what course/lesson (paste in URL), what error you getting and paste in your code


var main = function(){
  // click article to initiate the code
    // set the letter o as a shortcut
      if(event.which === 111){
        // current is the headline we click on
        // description is the paragraph that pops out under
  // hide all descriptions
    // add grey to the clicked on element
  // this=.article children that have the class description will be shown


this code runs fine in my own editor with no errors
I get this error from the codecademy editor
Oops, try again. It looks like the o key isn't opening a description. Remember to toggle the current article's description inside the event handler. Look back at the instructions for the code.


@smolderingflax First, you need to move the $(document).keypress(...); part outside of the $(".article").click(...); part.

Then, rather than $(this).siblings(...)... to remove the class, why don't you just use $('.article').removeClass("current");?


Inside the main() function under your click event handler, create a keypress event handler:
In that case the above line of instruction is ambiguous. It could be taken either way. Inside the main function ABOVE the click handler would be clearer. And Thank you for your concise and helpful reply. Although, that being the case, this should not have passed me to the next section. But it did. Buggy.



There's nothing we can do to fix the course right now, since Codecademy is planning on removing it sometime this year I've been told.

Sorry, it annoys me too :confused:


Are they updating it or quitting?


Removing this course, adding in extra bits to the jQuery and JavaScript courses as they update those. I don't know how similar any of the content in the updated courses will be to this one, though.


This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.