Implementing ashx, adapting javascript