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

The Archive Base Latest Questions

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

I’ve been sitting with this for hours now, and I cant understand why. q

  • 0

I’ve been sitting with this for hours now, and I cant understand why.

  • q is working. The URL does give me a proper JSON-response. It shows up as objects and arrays and whatnot under the JSON tab under the Net-tab in Firebug and all is fine. I’ve also tried with other URLs that i know work. Same thing happens.

  • I have another function elsewhere in my tiny app, wihch works fine, and is pretty much exactly the same thing, just another API and is called from elsewhere. Works fine, and the data variable is filled when it enters the getJSON-function. Here, data never gets filled with anything.

  • I’ve had breakpoints on every single line in Firebug, with no result. Nothing happens. It simply reaches the getJSON-line, and then skips to the debugger-statement after the function.

    var usedTagCount = 10;
    var searchHits = 20;
    var apiKey = "a68277b574f4529ace610c2c8386b0ba";
    
    var searchAPI = "http://www.flickr.com/services/rest/?method=flickr.photos.search&" + 
                "format=json&api_key=" + apiKey + "&sort=interestingness-desc&per_page="
                 + searchHits + "&jsoncallback=?&nojsoncallback=1&tags=";
    
    var tagString = "";
    var flickrImageData = new Array();
    
    function search(query) {
        for(var i = 0; i < usedTagCount; i++) {
            tagString += query[i].key + ",";
        }
    
        var q = searchAPI + tagString;
    
        $.getJSON(q, function(data) {   
            debugger; /* It never gets here! */
    
            $.each(data.photos.photo, function(i, item) {
                debugger;
                flickrImageData.push(item);             
            });
        });
    
        debugger;
        return flickrImageData;
    }
    

Example of request URL (q):

http://www.flickr.com/services/rest/?method=flickr.photos.search&format=json&api_key=a68277b574f4529ace610c2c8386b0ba&sort=interestingness-desc&per_page=20&jsoncallback=?&tags=london,senior,iphone,royal,year,security,project,records,online,after,

I do wonder, since JSONView (the firefox plugin) cannot format it properly, that it isn’t really JSON that is returned – the mime-type is text/html. Firebug, however, interprets it as JSON (as i stated above). And all the tag words come from another part of the app.

  • 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-12T22:49:28+00:00Added an answer on May 12, 2026 at 10:49 pm

    I think you might need to remove the

    nojsoncallback=1
    

    from your searchAPI string.

    Flickr uses JSONP to enable cross domain calls. This method requires the JSON to be wrapped in a json callback, the nojsoncallback=1 parameter removes this wrapping.

    EDIT: Apparently it works with nojsoncallback=1, I got this piece of code to work for me. What jQuery version are you using? JSONP is only available from 1.2 and up.

    This works for me (slight modifications):

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <script type="text/javascript">
    
    var usedTagCount = 1;
    var searchHits = 20;
    var apiKey = "a68277b574f4529ace610c2c8386b0ba";
    
    
    var searchAPI = "http://www.flickr.com/services/rest/?method=flickr.photos.search&" + 
                        "format=json&api_key=" + apiKey + "&sort=interestingness-desc&per_page="
                         + searchHits + "&jsoncallback=?&nojsoncallback=1&tags=";
    
    
    var tagString = "";
    var flickrImageData = new Array();
    
    
    function search(query) {
    tagString = query;
    
    
    var q = searchAPI + tagString;
    
    
    $.getJSON(q, function(data) {   
    
    
        $.each(data.photos.photo, function(i, item) {
                debugger;
                flickrImageData.push(item);                          
        });
    });
    
    }
    
    search("cat");
    
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm looking for suggestions for debugging... If you view this site in Firefox or
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have some data like this: 1 2 3 4 5 9 2 6
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.