I need to use ajax request, that sends the current picture to the server with the help of asynchronous call. Then on the server with a php script it counts the number of black and white cells on the table field. The result then comes back to the site and shows up in an alert window. So for example if i color 10 cells black and then press the button "Prestej" i must get with the help of ajax the result in a alert window (saying 10 black and 246 white). Do you maybe know how to do that? I have never used ajax, so i would appreciate the help.
Here is my code: