Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2011
    Thanked 0 Times in 0 Posts

    Possible Javascript Project

    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.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Thanked 4,745 Times in 4,707 Posts
    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.
    Last edited by VIPStephan; 12-14-2011 at 04:31 PM. Reason: don’t promote third party webhosting!
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


    LinkBacks (?)

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts