This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cross domain

 
fairoz khan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

My local:
i am calling one webservice url from normall html page. In my local its working fine without any IE settings.(environment is windows xp).But in my system Miscellaneous is disable in IE.

other machine:
when i am calling same url from sharepoint(using same code) i am facing error. (access-control-allow-origin domain).To reslove error i did below IE settings.(environment is window 7)

settings:Click the “Security” tab. Click the “Internet” icon, then click the “Custom Level” button. Scroll down to the “Miscellaneous”(enable it) section of the list in the Settings pane.

then its working in sharepoint.

my code:
$(document).ready(function() {

alert("kdfj");
var url="https://maps.googleapis.com/maps/api/geocode/json?address=bangalore&sensor=false";
$.ajax({

//cache: true,
dataType: "json",
crossDomain:true,
contentType:"application/json",
headers:{
Accept:"application/json",
"Access-Control-Allow-Method":"*"
},
type: "GET",
url: url,
success: function(jsonp) {
alert(jsonp);





}
});


});

But i dont want to do manually settings in IE.

is it possible to Enable to Miscellaneous from javascript or jquery or i want to do any changes in my code.

Thanks in advance.

Fairoz p.

 
Rob Crowther
author
Ranch Hand
Posts: 297
5
Android Fedora Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fix this from the server side by adding the access-control-allow-origin header mentioned in the error message.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic