It is not impossible to code on server side using javascript as there are frameworks available today which lets use of javascript on server side. But usage of this is not that high as most people prefer the normal way of using AJAX if they want javascript to interact with a server side language.