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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:59:02+00:00 2026-05-28T01:59:02+00:00

I am making a JSONP request in a chrome extension (content script) . Everything

  • 0

I am making a JSONP request in a chrome extension (content script) . Everything works very well when I am running as a webpage -loading the HTML file in my browser-, but when I load it as a chrome extension, the jsonp callback function created by jquery doesn’t seem to exist when the server gives its response.

My console says:

Uncaught ReferenceError: jQuery17105683612572029233_1323808231542 is not defined

Here is my ajax request:

$.ajax({
    url: 'http://example.com',
    data: 
    {
        imgUrl: this.href,
        returnString:true
    },
    dataType: "jsonp",
    success: function(msg){
        newNode.src = msg.data;
    },
    error: function(msg){
        console.log(msg.data);
    }
})
  • 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-28T01:59:02+00:00Added an answer on May 28, 2026 at 1:59 am

    The issue is that the JSONP response is being caught by the actual page, outside of the sandboxed JavaScript code that the Chrome content script limits you too.

    jQuery17105683612572029233_1323808231542 is the name of the callback function that the jQuery JSONP call has dynamically generated for the specific call. This function is being defined in the sandboxed area the content script has access to.

    The only workaround that I am aware of, which worked for me, is to make an XHR call from the content script. As of Chrome 13 you can make XHR calls cross-domain from the content scripts (pretty cool). In your manifest file you need to add the external URL to the permissions:

    {
        ...
        "permissions": [
            "http://example.com"
        ]
    }
    

    You can then make the XHR call like so:

    var xhr = new XMLHttpRequest();
    xhr.open("GET", "http://example.com/", true);
    xhr.onreadystatechange = function() {
        if (xhr.readyState == 4) {
           //handle the xhr response here
      }
    }
    xhr.send();
    

    You will need to do some of the things that jQuery was doing automatically for you, like encoding the values of the data object into the XHR URL (in your case the “imrUrl” and “returnString”) as well as convert the response from the xhr.responeText or xhr.reponseXML into an object.

    The downside of this approach is that if you are sharing this code between a Chrome extension and something else (like a bookmarklet) you now have to have different logic for the Chrome use case.

    For more info see: Chrome Extension XHR

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

Sidebar

Related Questions

I am making a cross domain request using script tag hack and jsonp. In
I'm making a jsonp request with jquery.ajax() like this: var cep = 99999999; $.ajax({
We're making some calls to some very simple JSON web services in .NET CF
I'm making a JSON-P request to an API via jQuery AJAX $('#fetch').click(function(){ $.ajax({ url:
I am doing a cross domain request using $.ajax . It works on Firefox
I'm making a request to an old server that serves up ill-formed JSON. It's
I'm making html widget for websites. Let's say, it will display current stock indexes.
I'm trying to get a jsonp callback working using jquery within a greasemonkey script.
What is the very, very simplest method of getting the RSS (or JSONP) feed
I'm making a cross-domain AJAX request using jQuery but my callback function is not

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.