Controlling the Spark Core pins with webpage buttons

STILL NOT WORKING ON PIN 7.
Dare I ask, how do we read a0 pin on the web.

this makes it work (same is pin0) so the problem is in the lines above
 digitalWrite(pinNumber, state);
   digitalWrite(7, state);// hard coded as a test. works!

I don’t fully understand the code above and not sure how to do a simple print to console so I can dig into the code