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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:17:19+00:00 2026-05-30T12:17:19+00:00

I’m facing the same issue, while trying for cross-domain request. Situation is strange, my

  • 0

I’m facing the same issue, while trying for cross-domain request. Situation is strange, my data is getting loaded while hit the requested url directly on browser, the strange part is, this gets loaded if requested using jquery ajax as well,
but not on firebug console, but on firebug net tab.
Console prints:
Sample of error data: parsererror {while json data is well-formed and formatted, checked on json validators}

readyState: 4 status: 200 responseText: undefined

Net tab loads all the data in response and json sub-tab

My sample code is:

function fetchJsonData() {
$.ajax({
    type: 'POST',
    url: 'http://www.meilleurmobile.com/comparateur/resultats-comparateur-json.do',
    data: 'monthDur%5B0%5D=45.75&monthDur%5B1%5D=45.75&monthDur%5B2%5D=45.75&monthDur%5B3%5D=45.75&monthDur%5B4%5D=45.75&monthDur%5B5%5D=45.75&monthDur%5B6%5D=45.75&monthDur%5B7%5D=45.75&monthDur%5B8%5D=45.75&monthDur%5B9%5D=45.75&monthDur%5B10%5D=45.75&monthDur%5B11%5D=45.75&numSms=1000&dataVolume=1000&withoutMobile=-1&commitmentDuration=-1',
    async: false,
    cache: false,
    //contentType: 'application/json; charset=utf-8',
    crossDomain: true,
    dataType: 'jsonp',
    error: function( xhr,err ) {
        console.log( 'Sample of error data:', err );
        console.log("readyState: "+xhr.readyState+"\nstatus: "+xhr.status+"\nresponseText: "+xhr.responseText);
    },
    success: function( data ) {
        if (console && console.log) {
            console.log( 'Sample of data:', data.slice(0,100) );
        }
    }
})
.done(function() { alert("success"); })
.fail(function() { alert("error"); });

}

  • 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-30T12:17:20+00:00Added an answer on May 30, 2026 at 12:17 pm

    Attempted cross domain XMLHttpRequest requests may fool you. In Firefox web console, it may look like URL loaded fine, but body is an empty string.

    Confirm that the server supports JsonP. If you don’t really know what that means, you need to look it up. It is critically important.

    jQuery assumes that the JsonP parameter is going to be “?callback=”. If that is not true, you should see this: http://api.jquery.com/jQuery.ajax/

    jsonp: Override the callback function name in a jsonp request. This value
    will be used instead of ‘callback’ in the ‘callback=?’ part of the
    query string in the url. So {jsonp:’onJSONPLoad’} would result in
    ‘onJSONPLoad=?’ passed to the server. As of jQuery 1.5, setting the
    jsonp option to false prevents jQuery from adding the “?callback”
    string to the URL or attempting to use “=?” for transformation. In
    this case, you should also explicitly set the jsonpCallback setting.
    For example, { jsonp: false, jsonpCallback: “callbackName” }

    jsonpCallback: Specify the callback function name for a JSONP request. This value
    will be used instead of the random name automatically generated by
    jQuery. It is preferable to let jQuery generate a unique name as it’ll
    make it easier to manage the requests and provide callbacks and error
    handling. You may want to specify the callback when you want to enable
    better browser caching of GET requests. As of jQuery 1.5, you can also
    use a function for this setting, in which case the value of
    jsonpCallback is set to the return value of that function.

    If it gets confusing, it may be easier to just do it the old fashioned way and appends the script to the page yourself with a time stamp in the URL to avoid using a cached script page.

    BTW, AFAIK, there is no way to combine JSONP and POST. JSONP is a way of working around the same origin security policy of XMLHttpRequest. It requires you to append a script to the DOM. I don’t think you can do that and also submit POST variables as part of the process.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want to construct a data frame in an Rcpp function, but when I
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
I am trying to loop through a bunch of documents I have to put

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.