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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:55:21+00:00 2026-05-14T05:55:21+00:00

I need to do a cross-domain request in a chrome extension. I know I

  • 0

I need to do a cross-domain request in a chrome extension. I know I can it via message passing but I’d rather stick to just jQuery idioms (so my javascript can also work as a <script src="">).

I do the normal:

$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?", function(data) {
  console.log(data);
});

but in the error console I see:

Uncaught ReferenceError: jsonp1271044791817 is not defined

Is jQuery not inserting the callback function correctly into the document? What can I do to make this work?

(If I paste the code into a chrome console, it works fine, but if I put it as the page.js in an extension is when the problem appears.)

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

    Alas, none of these worked, so I ended up doing the communication via the background.html.

    background.html

    <script src="http://code.jquery.com/jquery-1.4.2.js"></script>
    <script>
    function onRequest(request, sender, callback) {
      if (request.action == 'getJSON') {
        $.getJSON(request.url, callback);
      }
    }
    
    chrome.extension.onRequest.addListener(onRequest);
    </script>
    

    javascripts/page.js

    chrome_getJSON = function(url, callback) {
      console.log("sending RPC");
      chrome.extension.sendRequest({action:'getJSON',url:url}, callback);
    }
    
    $(function(){
      // use chrome_getJSON instead of $.getJSON
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I need to make a a cross domain request where the response is
I simply need to get the 'html' from a particular (cross domain) request. I'm
Possible Duplicate: JQuery ajax cross domain I need to load content from another websites
I need to use YQL (Yahoo Query Language) to perform a cross domain ajax
I need to use foursquare API to search venues. Of course it is cross-domain.
I need to write cross-platform GUI application, what toolkit can I use? Currently I
I need soime data from other server using ajax request. Is it posibel cross
I am trying to make a cross domain HTTP request to WCF service (that
Its not explicitly cross domain sessions that I am looking for, but its the
I'm sending a cross-domain jsonp request to /isauthenticated, which routes to a function that

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.