Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7527025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:00:01+00:00 2026-05-30T04:00:01+00:00

I am trying out jQuery 1.6.4 with mobile to get a simple json feed

  • 0

I am trying out jQuery 1.6.4 with mobile to get a simple json feed and display it as a learning exercise. I can’t get the callback in the getJSON to fire though. The json feed is open and public so that’s fine. Could this be a jQuery 1.6.4 + mobile issue?

    $.getJSON('https://raw.github.com/currencybot/open-exchange-rates/master/latest.json', 
      function (data) {
        var items = [];

        $.each(data, function (key, val) {
            items.push('<li id="' + key + '">' + val + '</li>');
        });

        $('<ul/>', {
            'class': 'my-new-list',
            html: items.join('')
        }).appendTo('body');
    });
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T04:00:03+00:00Added an answer on May 30, 2026 at 4:00 am

    You can’t do an AJAX request to this URL because it would violate the same origin policy. See http://e-mats.org/2010/01/jquery-getjson-and-the-same-origin-policy/ for an explanation. Here’s a quote:

    When creating a simple mash-up with data from external sources, you
    usually want to read the data in a suitable format – such as JSON. The
    tool for the job tends to be javascript, running in your favourite
    browser. The only problem is that requests made with XHR
    (XMLHttpRequest) has to follow the same origin policy, meaning that
    the request cannot be made for a resource living on another host than
    the host serving the original request.

    To get around this clients usually use JSONP – or a simple
    modification of the usual JSON output. The data is still JSON, but the
    output also includes a simple callback at the end of the request,
    triggering a javascript in the local browser. This way the creator of
    the data actually tells the browser (in so many hacky ways) that it’s
    OK, I’ve actually thought this through. Help yourself.

    Basically, regular AJAX uses XMLHtmlRequest, which has same-domain security policies in place. JSONP, on the other hand, inserts a script tag (without same-domain origin policies) that runs a callback function. But the end server has to support this since it is responsible for actually generating the script with the callback function.

    If the server supports JSONP, you can do this by adding callback=? to the request parameters in the url you call with getJSON. But it doesn’t look like this endpoint supports JSONP (adding callback=? does nothing).

    So you will probably have to create a proxy endpoint on your server to access this data. Basically, create an endpoint on your own server that loads that data using whatever method makes sense (curl, etc..) and returns it exactly as-is. Then you can use regular AJAX to call your own server endpoint (same server = does not violate the same origin policy).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hope can help, trying out Jquery clone which seems to work, but I get
I've been pulling my hair out trying to use jQuery.get() to pull in my
I'm trying out PhoneGap 1.4 on Windows Phone 7.5 using jQuery mobile (1.0.1.). Basic
I am trying to find out why jquery can't return the actual heigth of
Trying to do a simple web app with jquery mobile. I have put together
I'm using jQuery Mobile and trying to figure out how to change a page
I am trying out Jquery Mobile DateBox. See here: mobile date box In the
I've been trying out tables in my jquery mobile projects but they don't look
I'm starting to dive into jQuery Mobile and I'm trying to figure out how
I'm trying out jQuery to send POST and GET requests to Django. So far

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.