0

So I'm trying to use the steam web api and create a simple page that displays the user's friend list. So far I managed to get an arraylist containing all the steam-64 ids of the user's friend list. However, the problem is I tested this on the live view feature in Dreamweaver.

When I load it into Google Chrome, nothing displays it returns this error in the console:

Uncaught NetworkError: Failed to execute 'send' on 'XMLHttpRequest'. Failed to load http://api.steampowered.com/ISteamUser/GetFriendList/v0001/?key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&steamid=76561197960435530&relationship=friend

However, when I test it using the live feature on Dreamweaver, I get this:

enter image description here

The steam-id shown below the sign in button demonstrates that my code is working.

I am currently using xampp (so apache) to run my php file. I have configured it in Dreamweaver properly and I've also enabled mod_rewrite and mod_proxy. However, the request cannot still be loaded when I display in Google Chrome.

If anyone can please help, it would be appreciated.

Varun Iyer
  • 523
  • 2
  • 10
  • 25
  • it is cross domain request, so the browser will apply [Same Origin Policy](https://www.w3.org/Security/wiki/Same_Origin_Policy) – Arun P Johny Aug 30 '14 at 03:15
  • So how do I fix that? – Varun Iyer Aug 30 '14 at 03:16
  • see http://stackoverflow.com/questions/3076414/ways-to-circumvent-the-same-origin-policy – Arun P Johny Aug 30 '14 at 03:17
  • from the documentation it doesn't look like they are supporting either CORS or JSONP... so one solution is to make your webserver act like a proxy... ie you sent the ajax request to your server which will make a http request to the remote api and forward the returned data to the client browser – Arun P Johny Aug 30 '14 at 03:19
  • @ArunPJohny how woukd I be abke to do that? Sorry I am kind of new to web servers.and php. – Varun Iyer Aug 30 '14 at 03:26
  • @ArunPJohny can you join my chat please? http://chat.stackoverflow.com/rooms/60287/cors-enable – Varun Iyer Aug 30 '14 at 11:15
  • @ArunPJohny okay but could you at least help me solve the CORS problem? – Varun Iyer Aug 30 '14 at 11:25

0 Answers0