View Full Version : Possible Javascript Project

12-13-2011, 12:14 PM
In college i need to make a website, i have chosen to do one about gaming. One of the tools i want to add in about javascirpt is how to get a Xbox360 Gamercard to be in a corner off the website and updates when new achievements are earned. I understand i need to be able to connect to xbox.com to get details on the gamertag but i am new to the javascript language. Has anyone done a script for anything like this or know where i can find one. Ive tried googling etc for one and tried it for myself but i aint getting no where, let alone know if what ive tried scripting even exsists.

Old Pedant
12-13-2011, 11:02 PM
You probably can't do this from JavaScript, alone.

JavaScript can *NOT* read from any URL that is not on the same website as where the page containing the JavaScript was launched from.

That is, if your site is www.example.com and your web page is www.example.com/mypage.html then any JavaScript in that page can *only* read files/data from www.example.com

In order to pull data from xbox.com, you will probably need some server-side code (PHP/ASP/JSP). Now, that server-side code *could* be a dirt-simple "proxy" that just goes to xbox.com, grabs the data, and then repackages it for you JS code. You'll have to decide if that is the way you want to do it or whether you want the server-side code to be "smarter" and do some processing for you, as well.