Jump to content

Ajaxish call without server side code?


aspnetguy
 Share

Recommended Posts

I need to make a call to some RESTful APIs and would like to avoid using server side code if at all possible.I can easily make the calls using AJAX and PHP's get_file_contents($myurl) but in some cases server side langauges are not available.A sample call would be to http: //twitter.com/statuses/user_timeline/username_goes_here.jsonIf I try a regular AJAX request I get Access Denied as expected because it is outside my applications domain. Is there anyway to trick the browser into thinking it is the same domain or another method to get this web service with only JS?

Link to comment
Share on other sites

No. You may be able to pass the URL to your own PHP file and then from PHP, get to the web service, but this again requires PHP, so... there's no way.

Link to comment
Share on other sites

No. You may be able to pass the URL to your own PHP file and then from PHP, get to the web service, but this again requires PHP, so... there's no way.
That is what I am doing now. I am developing a JS wrapper for Twitter and had a feature request for a pure JS method. Didn't think it was possible. Thanks.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...