Ajax and conditional DOM scripting

Ajax and conditional DOM scripting

Hi,

I'm a bit stuck here. I'm using jQuery together with php and would like to do the following.

Situation:
  • I have a list with tasks in a table
  • each task has a checkbox
  • when a user clicks a checkbox, the task is set to 'done' (this is done by an ajax callback)

Now I would like to execute some conditional javascript.

This is my php in pseudo code:

sql_query(SET TASK TO DONE);

if(usersettings[showtasks] == true)
   javascript: table row background-color=green;
else
   javascript: table row delete;


The sql query works fine but how do I manage to execute the javascripts?

Thanks in advance!

Nick