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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:57:38+00:00 2026-05-17T17:57:38+00:00

I have the following script in my web page to call out to a

  • 0

I have the following script in my web page to call out to a JSON-enabled WCF service that I have created and am hosting on my web server. However, the alert displays “null”. When I point to the url in a browser it returns very simple JSON: {"city":"Ann Arbor"}. Also, when I run the page containing the code below with Fiddler running, I can see the service is hit and the JSON returns. But still the success function below returns null. Anyone know what I’m doing wrong? Thanks. -Ned

<script type="text/javascript">
    $.ajax({
        type: "GET",
        url: "http://192.168.192.17:8080/Service.svc/class/",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            alert(data);
        }
    });
</script>
  • 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-17T17:57:39+00:00Added an answer on May 17, 2026 at 5:57 pm

    I suspect the problem comes from the fact that you are trying to call a web service using AJAX which is not hosted on the same domain as the calling script and thus you are violating the same origin policy. If you want to be able to call http://192.168.192.17:8080/Service.svc using AJAX, the calling script needs to be hosted also on http://192.168.192.17:8080.

    As a possible workaround you could use a server side script acting as bridge hosted on the same domain as the client script or use JSONP if you have control over the web service.

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

Sidebar

Related Questions

I have the following example page structure: Webpage.aspx Script.aspx If I call Server.Execute(Script.aspx) from
I want to call a web service that returns JSON object, the web service
In an ASP.NET MVC aspx page I have the following script: <script type=text/c# runat=server>
I have following script that executes all the .reg files in the current directory.
I have the following script which appears multiple times on my page. I have
Presently i have the following code on one of my web page- <a href=http://ex.com
I have the following javascript code (at bottom) that I inject per api call
I have a page, test.php, with the following code: <html> <body> <form> <script type=text/javascript>
I have an web service named AEWService.asmx with the following code: using System; using
On my web page I have a button that opens a modal jQuery dialog.

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.