-2

Error from firebug:

missing ) after condition
[Break on this error] else if (($(this).parent...nt().hasClass('plaing')==true) ) {

The code:

$(".myButtonPlay").live('click',function(){
     if ($(this).parent().parent().hasClass('current')==false){  

       console.log($(this).children().attr('src'));
       var media=$(this).parent().parent().attr('media');
       var id=$(this).parent().parent().attr('id');
       $(this).parent().parent().addClass('plaing');

       $(this).find('img').attr('src','http://localhost:8000/silver/images/btn_pause.gif')
       play_media(media, id);


            }
      else if (($(this).parent().parent().hasClass('current')==true) $$ ($(this).parent().parent().hasClass('plaing')==true) ) {   
     $(this).parent().parent().removeClass('plaing');
      $('#mediaPlayer').attr('player').pause();
      $(this).find('img').attr('src','http://localhost:8000/silver/images/btn_pause.gif');

          }
     else  if ( ($(this).parent().parent().hasClass('current')==true) $$ ($(this).parent().parent().hasClass('plaing')==false)  ){    
     $(this).find('img').attr('src','http://localhost:8000/silver/images/btn_paly.gif');
     $(this).parent().parent().addClass('plaing');
     $('#mediaPlayer').attr('player').play();

         }

});

Where is the problem? Looks like error is in conditions of second if statement....

2
  • What editor are you using? Any decent editor with parenthesis matching would help catching the error... Commented Sep 3, 2010 at 13:54
  • Eclips With Amateras plugin.. It's work perfectly and not show me any mistake Commented Sep 3, 2010 at 13:56

3 Answers 3

6

Unless I'm missing something, $$ is not an operator... maybe you meant &&?

Sign up to request clarification or add additional context in comments.

3 Comments

Ohhh мазерфакa! Thanks man... It's because i did not drink coffee today :)
no coffee, no code. "Programmers are organisms that convert caffiene into code" :)
Pulling my answer as they're the same. +1.
0

$$ is not a valid operator. Reading your code it seems like you were trying to use the && operator.

2 Comments

yeah, saw it after I posted my answer. Always bad when you get sidetracked while writing an answer...
You could just click delete. I did it. g.d.d.c did it.
0

JSLint is your friend, or at least it want's to be.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.