AJAX Call to Web Service Error - This page is accessing information...

AJAX Call to Web Service Error - This page is accessing information...

Hi All,

I am trying to make a web service call which returns some HTML to be rendered on the client (Code below). When the code runs, I get the following error:

'This page is accessing information that is not under its control. This poses a security risk. Do you want to continue?'

I understand the browser is complaining that data is coming from another site, which may of course be insecure - Basically, a XSS/Cross Site Scripting problem.

Question is - Is there a way to achieve the same result without the error? There must be a way, as there are plenty of content providers that manage to achieve this sort of thing, e.g. A local weather/news report on your site etc, all using JavaScript.

Any help much appreciated!!

Thanks,
Simon.

PS: Switching the browser security off is not an option! :o)
  1. function GetAndRenderSurvey(BookingID) {
  2.     $.ajax({
  3.         type: "POST",
  4.         url: $.MyCompany.WebServiceURL + "/GetSurveyForm",
  5.         data: "{'SurveyTypeID': '" + $.MyCompany.SurveyTypeID + "','TableClass': '" + $.MyCompany.TableClass + "','TDClass': '" + $.MyCompany.TDClass + "','BookingID': '" + BookingID + "','ValidationErrorClass': '" + $.MyCompany.ValidationErrorClass + "'}",
  6.         contentType: "application/json; charset=utf-8",
  7.         dataType: "json",
  8.         success: function(msg) { GetSurveySuccess(msg); },
  9.         error: AjaxFailed
  10.     });
  11. }