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.
It used to be that you couldn't upload files via AJaX; now HTML5 has formData. Google "formData" and go that route - or you could use an iframe to upload the file with.
__________________ ^_^
If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
* The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".
Hmm, I think you have misunderstand me. I dont have to upload any file. Just send via ajax the picture so that the php script can count the colors? Or am I thinking something wrong here?
Unless I'm missing something, you can't "send" the picture to the server without uploading it. Unless you mean to read the file and parse the binary bits on the client-side, then send that as a string to the server. In which case, that's above my paygrade. (If it can be done.)
__________________ ^_^
If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
* The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".
well, you could put the color values into form controls and submit the form to your php script, or you could use javascript to collect the values and use ajax to send them to PHP.
if you post the code you have, we can help you get it working up to the point it hands off to PHP, at which point you'll need to move the discussion to s server-side forum.
__________________ my site (updated 5/13) STATS (2013/5) HTML5:90.2% MOB:14% IE7:0.5% IE8:8.6% IE9:9.8% IE10:10%