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)
- function GetAndRenderSurvey(BookingID) {
- $.ajax({
- type: "POST",
- url: $.MyCompany.WebServiceURL + "/GetSurveyForm",
- data: "{'SurveyTypeID': '" + $.MyCompany.SurveyTypeID + "','TableClass': '" + $.MyCompany.TableClass + "','TDClass': '" + $.MyCompany.TDClass + "','BookingID': '" + BookingID + "','ValidationErrorClass': '" + $.MyCompany.ValidationErrorClass + "'}",
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- success: function(msg) { GetSurveySuccess(msg); },
- error: AjaxFailed
- });
- }