7. The 'o' shortcut



<My code actually behaves ok, I am just getting the following error message:

Error Message: _"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."

Testing it out, the 'o' shortcut toggles the description of the selected article on and off as I believe it should. I'm just curious what the SCT might be looking for?

Thanks in advance for any/all help._>

function main() {};


 $('.article').click(function() {    
//*function opening ( closed line 16, open brace closed line 16*\\

    $(document).keypress(function(event) {  
//*function opening ( closed line 18, function brace closed line 18*\\
    if(event.which === 111) {
 });//*closing brackets for keypress function*\\
  });//*closing brackets for click function*\\
  //*'o' shortcut does function in window.


Hi you code should have this structure

var main =  function() {
    $('.article').click(function() {    
    }); #close article click function

    $(document).keypress(function(event) {  
   }); #close document keypress function
}#close the main functon

#Then at the end put this line


Thanks a lot, @wizmarco. The two mistakes that you pointed out satisfied the problem. May I ask whether what I needed to fix was for the benefit of the SCT or was my code, in fact, in error?

As I said, it was still functional, however maybe I was setting myself up for bugs down the line? I'd just like to know what's up.


what I needed to fix was for the benefit of the SCT or was my code, in fact, in error?
it was an error..
because like you can see


you put the main (which is the main function) inside the .ready() so if you doesn't have anything inside it

function main() {};

it normaly should give you an error..


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