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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:22:38+00:00 2026-06-15T23:22:38+00:00

I am attempting to call this web service: http://www.civicapps.org/datasets/restaurant-inspections Here’s my code: <script> $(document).ready(function()

  • 0

I am attempting to call this web service: http://www.civicapps.org/datasets/restaurant-inspections

Here’s my code:

<script>
            $(document).ready(function() {

                function showInspections() {
                    var data = $.ajax({
                                type : 'GET',
                                url : '//api.civicapps.org/restaurant-inspections/',
                                async : false,
                                dataType : 'json',
                                success: function(data){
                                    if(data.status == "ok"){
                                    alert(data);
                                    }
                                }
                            });     
                        }
                showInspections();
            });
        </script>

Firebug Net>XHR shows “200 Status OK” and yet there is no response with the JSON data. Likewise, Console tab shows the same GET request and status but the text for it is in red.

Questions:

  • Am I failing to receive the response data in JSON due to cross-domain issues i.e. the data should be sent in JSONP rather than JSON? If so, is there a way to get around this solely from my end, assuming the response will not be sent in JSONP?
  • What does the red text in Firebug console indicate?
  • 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-15T23:22:39+00:00Added an answer on June 15, 2026 at 11:22 pm

    Am I failing to receive the response data in JSON due to cross-domain issues i.e. the data should be sent in JSONP rather than JSON?

    Yes. JSONP is actually very different than “JSON” (i.e. an AJAX request that returns JSON-formatted data). Even though the responses look very similar and the implementation in jQuery is very similar (just add a ‘p’!), the actual architecture of JSONP is very different. In fact, JSONP is not even AJAX (if by AJAX you mean something that uses XMLHttpRequest). JSONP gets around cross-domain issues by using a trick involving a dynamically generated <script> element.

    If so, is there a way to get around this solely from my end, assuming the response will not be sent in JSONP?

    Fortunately, no. While this may be unfortunate for you, it’s fortunate for the web. Because if you could get around cross-domain issues from the client side, the web would be far less secure. Imagine you went to my website and some hidden JavaScript downloaded all your new emails from Gmail, parsed them, then sent them to my server. That would be possible if not for the same-origin policy.

    JSONP is nice because it offers a workaround for cross-origin requests that services can opt-in to. If a service wants to be accessible cross-domain, then it can be written in JSONP. This prevents unwitting cross-domain services while allowing for services to volunteer cross-domain availability.

    What does the red text in Firebug console indicate?

    It probably indicates a violation of the same-origin policy.

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

Sidebar

Related Questions

I am receiving this error when attempting to add a new web service to
I have some code that makes a call to a third party web service
I'm attempting a basic AJAX call where I send the address 'www.google.com' to urlpost.php
I am attempting to consume an intranet web service with WCF. I added reference
I'm attempting to use an HttpDelete object to invoke a web service's delete method.
I am attempting to call a RESTful service using an HttpWebRequest object via POST.
I am attempting to learn cURL to use a JSON web service. I tried
I'm attempting to talk to a web service for locations within the zoomed-in or
I am attempting to call a controller via an actionLink() in a view. This
I have a WCF ASP.Net 4.0 web service we'll call WebService. WebService is consuming

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.