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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:17:02+00:00 2026-05-14T14:17:02+00:00

I am trying to acess a wcf service from a jQuery client Specifically this

  • 0

I am trying to acess a wcf service from a jQuery client

Specifically this example
http://www.codeproject.com/KB/aspnet/WCF_JQUERY_ASMX.aspx#4

All works well when the client webpage is on the same domain as the service

As soon as I move the client webpage to another domain it breaks. It cant reach the service and the request fails

This happens for all the examples, ASMX, REST and WCF

any ideas how to get this working cross daomain?

  • 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-14T14:17:02+00:00Added an answer on May 14, 2026 at 2:17 pm

    You are running up against the Same-Origin Policy. The web service that you are accessing must reside on the same domain as the jQuery script that is making the request. This policy is enforced by all browsers to prevent – for example – cross-site scripting and code injection attacks on web applications.

    There are various ways around it, including JSONP, Proxies or Flash.

    We’ll need a little more information before we can suggest which technique you should use. I tend to favor JSONP. But in the meantime, here’s some light reading:

    http://taossa.com/index.php/2007/02/08/same-origin-policy/

    https://developer.mozilla.org/En/Same_origin_policy_for_JavaScript

    Here’s an example use of JSONP:

    url = "http://www.test.com/getData.php?callback=parseResults";
    
    document.body.appendChild((function() {
        var newScript = document.createElement("script");
        newScript.type = "text/javascript";
        newScript.src = url;
        return newScript;
    })());
    
    function parseResults(data) {
        alert(data);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to send data from a client application using jQuery to a REST
i am trying to access a https wcf service from silverlight. the clientaccesspolicy is
I'm trying to use WCF Data Service with Subsonic, but ran into this error
Im trying to access a web service from a remote computer. I managed to
So I'm trying to create a C# WCF REST service that is called by
I am trying to access a WCF web service, that is using two way
This is my first try trying to use WCF, so I'm guessing I'm doing
I am trying to access Outlook 2007 from C#. I have installed the PIA
I'm trying to access the Facebook API Admin.getMetrics method via jQuery. I'm correctly composing
I am trying to access a view inside a splitter from my mainframe. At

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.