This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cross domain

 
fairoz khan
Greenhorn
Posts: 9
  • 0
  • 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
  • 0
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic