Jump to content

Ajaxish call without server side code?


aspnetguy

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...