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 7555223
In Process

The Archive Base Latest Questions

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

Ok for some reason my script does not return any data from a JSON

  • 0

Ok for some reason my script does not return any data from a JSON file witch is being fetched from 3rd party site.

Here is the code

$(document).ready(function() {
    var url =  "http://konachan.net/post/index.json?limit=20&tags=hatsune_miku";
    $.getJSON(url + "&callback=?", null, function(items) {
        for(i in items) {
            item = items[i];
                        $("#content").append('<div class="product" id="product-' + item.id + '"><img src="' + item.preview_url + '" width="135" height="138"/><div class="title">' + item.author + '</div><div class="description" style="overflow:hidden;">' + item.tags + '</div><div class="clear"></div></div>');
        }
    });
});

What the heck is wrong with it?

Edit: PHP Curl still no work: http://pastebin.com/5gVUviZw

  • 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-30T11:33:04+00:00Added an answer on May 30, 2026 at 11:33 am

    I hit the url http://konachan.net/post/index.json?limit=20&tags=hatsune_miku&callback=test with a callback parameter, and I do not see the JSON wrapped in a function name.

    The way JSONP works is when you pass a callback function name, the server should wrap the JSON in that function so that when the JavaScript is returned from the server, the callback function is called, and the JSON data is passed in as a parameter.

    // "test" was the callback parameter I used
    test({ "my": "data" , "returned_from" : "server" });
    

    Under the hood, JSONP uses script elements to download the JavaScript (JSON) from the remote server.

    Since the JSON in your url isn’t being wrapped in a function name, you can’t get easy cross-domain access to it. Here is the Wikipedia Article on JSON with Padding, which explains in more detail.

    Perhaps you might check the documentation of that particular resource, as it’s quite possible they’re using a parameter other than “callback” to specify a callback function to “pad” the data with.

    If there is no parameter to wrap the result in a function name, you could use a server-side proxy to obtain the JSON response and wrap it up in a function, which you then return to the client side.

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

Sidebar

Related Questions

For some reason, Section 1 works but Section 2 does not. When run in
For some reason, onreadystatechange call back function is not being called in asynchronous mode.
For some reason the script below is not working. This is the code I
For some reason This php script won't echo anything: <?php setcookie(pop,'hi',time()+604800); echo $HTTP_COOKIE_VARS['pop']; ?>
For some reason, we have a script that creates batch files to XCOPY our
For some reason I never see this done. Is there a reason why not?
I am working on a very simple script but for some reason parts of
I am working on a script that downloads a file from Dropbox, supposed to
For some reason, I want to serve my robots.txt via a PHP script. I
I have the following script which does not work. it should be using jquery

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.