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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:53:04+00:00 2026-06-10T08:53:04+00:00

I am using the following API call in jQuery to retrieve data. I’ve appended

  • 0

I am using the following API call in jQuery to retrieve data. I’ve appended ?callback=? at the end which seems to get around the cross origin domain issue, if I don’t include that I get the cross domain error.

In chrome it says, “Resource interpreted as script but transferred with MIME type text/html.”

The response returned is Content-Type: text/html; charset=UTF-8.

I can see the response by looking at it in Chrome Console → Resources. But how can I manipulate the response in JavaScript?

$.getJSON("http://api.visistat.com/stats-api-v2.php?key=skx79q0pyu01.&qt=idd&d=json&sdate=2012-08-26&edate=2012-08-28?callback=?", function(json) {
    console.log(json);
});

I do not have access to change the API.

Update:
Trying to work around using YQL e.g. http://jsfiddle.net/4VEHR/5/

Looks like this plugin may also be useful: https://github.com/padolsey/jQuery-Plugins/tree/master/cross-domain-ajax/

  • 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-10T08:53:06+00:00Added an answer on June 10, 2026 at 8:53 am

    Unless you have control over api.visistat.com and can modify the stats-api-v2.php script, there is nothing you can do besides contacting the service and asking them to fix the headers they send with the response (it needs Content-Type: text/json, while the PHP default is text/html). On the browser side, the warning you get occurs before Javascript has had any chance to work with the data — jQuery instantiates a <script> element with your API URL as its source, and the browser notices the content type mismatch immediately when the response is received, before passing it back to jQuery.

    This warning is harmless, though. The real problem is that the service you’re using does not support JSONP — you provide the callback parameter as specified in the jQuery documentation to force JSONP result expectation, but the service does not actually produce valid JSONP (it still produces plain JSON). I’ve tried changing d=json to d=jsonp in your API request, but apparently it is not supported by the service. You will need to figure out a way to get JSONP result from the service, or implement a server-side proxy on your domain, to the avoid cross-domain issues.

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

Sidebar

Related Questions

I'm just starting to use the Twitter API to retrieve data using jQuery. I've
I'm making the following call in jQuery, using jsonp as my data format, that
I'm experimenting with MCV using jquery. I'm making a call to an api, which
I'm using Bing API to search for images by going the following call: http://api.bing.net/json.aspx?AppId=[my
The jQuery docs at http://api.jquery.com/on/ mention the benefits of delegated-events using the following syntax
The jQuery documentation lists the following example of using $.getJSON to request JSONP: $.getJSON(http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?,
I am using jquery ajax api to submit (POST/GET) a text as parameter to
I am using following api to initialize sockfd at client side:(sockfd=3) if ((sockfd =
I'm using the following functions: # The epoch used in the datetime API. EPOCH
I am using the following plugin: http://flowplayer.org/tools/scrollable.html and under the sub-heading of Scripting API

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.