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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:00:09+00:00 2026-06-04T07:00:09+00:00

I was trying to call eBay FindProducts API using AJAX ( post request) but

  • 0

I was trying to call eBay FindProducts API using AJAX (post request) but was stuck at the following error:

XMLHttpRequest cannot load http://open.api.ebay.com/shopping?callname=FindProducts. Origin http://localhost.com/test.php is not allowed by Access-Control-Allow-Origin.

My code:

$.ajax
({
    type: "POST",
    url: 'http://open.api.ebay.com/shopping?callname=FindProducts',
    dataType: ($.browser.msie) ? "text" : "xml",
    contentType: 'application/x-javascript',
    crossDomain : true,
    data: {
        'X-EBAY-API-APP-ID' : 'ebayAppId', 
        'X-EBAY-API-VERSION': '771', 
        'X-EBAY-API-SITEID': '0', 
        'X-EBAY-API-REQUEST-ENCODING': 'NV', 
        'X-EBAY-API-RESPONSE-ENCODING': 'json',
        'QueryKeywords' : '753759971632',
        'MaxEntries' : '3'
    },
    success: function (result) {
        alert('success');
        alert(result);
    },
    error: function (data) {
        alert((data));
    }
})

How can I get through this error.

I tried setting dataType : jsonp (I know XML is being retrieved, but to workaround the error I set it to jsonP). It works but jQuery was unable to parse the XML as the json response was expected.

  • 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-06-04T07:00:10+00:00Added an answer on June 4, 2026 at 7:00 am

    If you add &responseencoding=JSON to your URL you will get the response as JSON according to docs

    UPDATE
    Working example. What I’ve done is that I changed to dataType:'jsonp' added jsonp:'callbackname'. Because jQuery by default calls the callback parameter callback, but eBay expect it to be called callbackname. What you have to do is add your parameters to the data map. Make sure you use the correct parameter names, check the docs and use the URL method not the header method. Hope this helps.

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

Sidebar

Related Questions

I'm trying to call the HttpServerUtuility.URLDecode function in C# using Visual Studio 2005, but
I'm trying to make my first web service client for the eBay API using
I'm trying to upload a bulk data exchange call to eBay using their FileTransfer
I trying to call 2 functions in the same page to submit jquery-ajax at
I am trying to call the stored procedure using subsonic and getting Object Reference
I am trying to call cleartool from an java application, but cleartool hangs even
While trying to call an EJB made using NETbeans (using jdk1.7) from a client
I trying to call some ejb bean method from tread. and getting error :
A consumer is trying to call my REST API from client-side code (Javascript /
When trying to call this function in my code i get the error in

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.