Creating RGB color function, javascript error -


i'm trying create random colors using following function in javascript, getting error: syntax error: expected expression, got ')'. can tell me error message refers to?

function addevents(){

$('table').mouseover(function(){      var color = "rgb(";      (var i=0; i<3; i++){          var random = math.round(math.random() * 255);          color += random;          if (i<2){             color += ",";          } else {             color += ")";     };      $(this).css('color', color); }); 

you're missing "}" in code

if (i<2){   color += ","; } else {   color += ")"; } // <--- 1 missing 

usually debugger show line number error occured at


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -