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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:25:07+00:00 2026-05-12T07:25:07+00:00

I have an existing jQuery plugin which makes a lot of AJAX calls (mostly

  • 0

I have an existing jQuery plugin which makes a lot of AJAX calls (mostly JSON). I am wondering what is the quickest to allow it to do cross-site calls i.e. the $.get and $.post URL’s will not be from the same domain.

I have heard of JSONP, but was wondering if someone could give me an concrete example to go about the whole process. I want to make minimal changes if possible to my script. Should I use a proxy.php of sorts?

Thank you for your time.

  • 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-12T07:25:08+00:00Added an answer on May 12, 2026 at 7:25 am

    JSONP will allow you to do cross-site calls. See jQuery docs on that matter.

    The concept is simple: instead of doing a normal Ajax call, jQuery will append a <script> tag to your <head>. In order for this to work, your JSON data needs to be wrapped in a
    function call.

    Your server needs to send information in such way (PHP example):

    $json = json_encode($data);
    echo $_GET['jsonp_callback'] . '(' . $json . ');';
    

    Then, you can use jQuery to fetch that information:

    $.ajax({
      dataType: 'jsonp',
      jsonp: 'jsonp_callback',
      url: 'http://myotherserver.com/getdata',
      success: function () {
        // do stuff
      },
    });
    

    More information is available here: What is JSONP?

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

Sidebar

Related Questions

I have an existing jQuery plugin, now I want to extend it. Consider the
I have problem to add jQuery to some existing code, please help. We have
I have existing Linux shared object file (shared library) which has been stripped. I
I have existing code with their own makefiles which I want to load into
I have a code in javascript and I am using jQuery Calculation plugin (can
I'm wondering if there are any existing (ideally well documented) PHP or Javascript/jQuery libraries/plugins
I have found numerous jQuery plugins that allow you to flip an element; SmashUp
Whats the best way to hookup AJAX functionality to an existing Form using jQuery
I am using the Validation jQuery plugin to do some validation. I have a
I am implementing ajax star rating plugin which is given in the bakery article

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.