× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

How to display 3rd-party data that does not support JSONP when it's cross-domain

Adam Brons
Sep 16, 2014
<p>When trying to connect to a service that does not support JSONP one typically has to provide their own proxy server.  As a proof of concept to proxy AJAX requests you can use the following git repo.</p><p>https://github.com/ambrons/bls-gov-proxy</p><p>This provides a grunt default configuration that launches a node proxy server defined to talk to bls.gov and proxy a specific request back to the client so it may be displayed on the screen.  The goal of this example is to show end-to-end communication from the client to the server to the server and back to the client.  This isn't a prime example for using templating or the like.</p><p>While talking to the individual it might have also been good enough to use nginx and a proxy / forwarding rule to do the same thing.  Because the user specifically was attempting to use JQuery and do this client-side I felt sticking with the client-side / js ecosystem was the best approach.</p>

Get New Tutorials Delivered to Your Inbox

New tutorials will be sent to your Inbox once a week.

comments powered by Disqus