js to server working