I’ve been working more and more with nodejs and have to say I am really loving how easy it’s been to get to grips with. I’ll be posting up more about how I’m using node and the problems I’m using it to solve over the coming weeks. However I wanted to illustrate just how simple it is do something that would be more work in other languages such as PHP.
So here’s a quick example I created that illustrates how to make a simple JSONP call to a nodejs + express server.
Here’s the server side code:
and here’s the client side Html code:
To enable jsonp callback support in an ExpressJS application you just have to include the line: