Search code examples
phpjavascriptajaxweb-applicationsserver-side

Should a javascript web application use another server side language?


I want to create a web application. I do a lot of java and am not overly impressed with the web application frameworks available.

I was thinking about using another server side language like php but I don't want the learning curve.

This brings me to javascript. Can and should I perform all of the server side calls with ajax? I have a service oriented architecture available and can access all the data I need.

Is it more advantageous to use a server side language in conjunction with javascript to build a robust web application? Is it preferable to use pure javascript and make ajax calls to my web services?


Solution

  • Can and should I perform all of the server side calls with ajax?

    Yes. you can perform all of the server side calls with AJAX. Even now a days a lot of single page apps are emerging which make heavy use of AJAX and Javascript MVC to communicate with server. Even some of the javascript frameworks provide REST support inbuilt(e.g. - Backbone JS).
    But having said that, you should consider having fallback mechanisms for AJAX calls. So, if user has turned off the javascript he should be navigated to appropriate page. (Again this depends on your choice of whether to support nonJS or not)


    Is it more advantageous to use a server side language in conjunction with javascript to build a robust web application?

    The advantages for using javscript depend on your test case and mainly the audience for your service. But it is definitely more "adventurous" to move towards asynchronous communication, but only when you use it in a structured way. I suggest to go with any of the MVC framework on Javascript side for this.


    Is it preferable to use pure javascript and make ajax calls to my web services?

    Again preferance depends on the use case scenario of your web service. There is no harm in using javascript as such. The only thing is you should be little aware about security of the javascript calls you are making.