Skip to content
View in the app

A better way to browse. Learn more.

Tip.It Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Error requesting data from tip.it highscores [JSON]

Featured Replies

I am trying to make a web application and currently am working on trying to get it to simply pull a users highscores from http://www.tip.it/runescape/json/hiscore_user?old_stats=1&rsn=RSNAME currently I have it reading the username properly but I am getting an error from the server get request

 

XMLHttpRequest cannot load http://services.runescape.com/m=hiscore_oldschool/index_lite.ws?player=zezima. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:10315' is therefore not allowed access.

 

Was wondering if someone could help me out?

 

function getUserData( RSname ) {
    var requestURL = "https://www.tip.it/runescape/json/hiscore_user?old_stats=1&rsn=",
        request = new XMLHttpRequest();
    request.open( "GET", requestURL + encodeURIComponent( RSname ) );
    // various sanitizations should be employed on the backend when dealing with user input
    request.responseType = "json";
    request.addEventListener( "readystatechange", function() {
        if ( request.readyState == 4 ) {
            if ( request.status == 200 ) {
                // process response
                var user_stats = request.response
                populateStatList();
            } else {
                alert(errormsg);
            }
        }
    }, false );
    request.send();
}

 

  • 3 months later...

You need to use a backend langauge to do this such as PHP or C#. You cannot do it with javascript because of x-site scripting. That is why you are getting the access control origin.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.