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

  • Home
  • SEARCH
  • 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 6208503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:49:12+00:00 2026-05-24T05:49:12+00:00

I asked this morning a question about a jQuery code that’s not working (which

  • 0

I asked this morning a question about a jQuery code that’s not working (which grabs a json file using API) then some great people told that I must have the json file in jsonp to use callback , which I wasn’t have..

I communicated with the developer of the website that provides the API and he solved the problem so that it supports jsonp, but still the code doesn’t work !!

here is the code of the page (you can see it viewing the source of this page http://rawaji.com/test.html )

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
                    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<script src="http://code.jquery.com/jquery-latest.js"></script>
 <script>
  $(document).ready(function(){
    $.getJSON("http://api.qaym.com/0.1/countries/key=u2gTerCTZDudTCMhQBQ9&jsoncallback=?",
        function(data){
          $.each(data, function(i,item){
             $("#results").append("<span class='result' >" + item.name + "</span></br>");
            if ( i == 3 ) return false;
          });
        });
  });
  </script>

</head>
<body>
  <div id="results">
  </div>
</body>
</html>

just a little note, that FireBug tells me no errors in the code and even the console tells that the file imported correctly (see the image here http://twitpic.com/5yycg5 )

WHAT IS MISSING !! 🙁

UPDAATE:

I used another consoler and it shows me this message!

key=u2gTerCTZDudTCMhQBQ9&jsoncallback=jQuery16206894429267849773_1312140242381:-1
Resource interpreted as Script but transferred with MIME type
application/json.

I just know nothing about it, but I will search it. if someone has an idea, plz tell 🙂

  • 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-24T05:49:14+00:00Added an answer on May 24, 2026 at 5:49 am

    This works:

    $(function(){
        $.ajax({
            url: 'http://api.qaym.com/0.1/countries/key=u2gTerCTZDudTCMhQBQ9',
            dataType: 'jsonp',
            crossDomain:true,
            success:function(data){
                $.each(data, function(i,item){
                    $("#results").append("<span class='result' >" + item.name + "</span></br>");
                    if ( i == 3 ) return false;
                });
            },
            error:function(jqxhr,err,status){
                alert(status);
            }
        });
    });
    

    The 401 error coming back requires authentication – invalid API key.

    http://jsfiddle.net/AlienWebguy/CqrPe/

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

Sidebar

Related Questions

So, I asked a question this morning, which I did not phrase correctly, so
This morning I asked a pretty mundane question about my JS syntax, and someone
[Hi, I asked this question in the morning but could not get any response
I asked this question about how to debug server side applications and I think
Krumelur asked this question about how create a recipient bubble similar to the mail.app.
I asked this question , and someone suggested this type of schema. I'm not
I asked this question a while ago and got an answer that I thought
I asked this question previously: Disabling and Re-Enabling Dynamic Form Elements with JQuery but
(I asked this question in another way , and got some interesting responses but
I asked this question before, Here however I think I presented the problem poorly,

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.