tags:

views:

73

answers:

3

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....

+6  A: 

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

nico
Ohhh мазерфакa! Thanks man... It's because i did not drink coffee today :)
Pol
@Pol: it happens :)
nico
no coffee, no code. "Programmers are organisms that convert caffiene into code" :)
Here Be Wolves
Pulling my answer as they're the same. +1.
g.d.d.c
@Pol, watch yer language.
LarsH
A: 

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

Florian
This was already answered 6 minutes before :)
BalusC
yeah, saw it after I posted my answer. Always bad when you get sidetracked while writing an answer...
Florian
You could just click `delete`. I did it. g.d.d.c did it.
BalusC
A: 

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

JoshNaro
THanks....... :)
Pol