0

Is it possible to execute Javascript on server side and to get the result on a client ?

If it is possible, how can i make the request to the dedicated Javascript file from my client ?

In fact, i have created a mobile application with embeeded Javascript, (using Phonegap) but i would like to put all Javascript files on the server and make some requests to the server to get the result.

Thanks for your help

wawanopoulos
  • 9,614
  • 31
  • 111
  • 166
  • This link might helpful to you [http://stackoverflow.com/questions/1476967/pros-and-cons-of-serverside-javascript-implementation](http://stackoverflow.com/questions/1476967/pros-and-cons-of-serverside-javascript-implementation) – Bhavesh Parekh Dec 26 '13 at 11:16
  • This one too [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Server-Side_JavaScript/Walkthrough](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Server-Side_JavaScript/Walkthrough) – Bhavesh Parekh Dec 26 '13 at 11:17
  • Check with node.js [http://www.hongkiat.com/blog/node-js-server-side-javascript/](http://www.hongkiat.com/blog/node-js-server-side-javascript/) – Bhavesh Parekh Dec 26 '13 at 11:20

1 Answers1

0

See You have to create a Web Service on the Server Side to enable the Client(Phonegap App) to make an Ajax request and fetch some data.

Earlier you could have written a web service using programming languages like PHP, .NET, Java, Ruby, Python etc. But NodeJS provides the flexibility of writing REST Based web services in Javascript itself.

You can learn about it here: http://appsonmob.com/nodejs-expressjs-mysql/

Rahat Khanna
  • 4,570
  • 5
  • 20
  • 31